PatchToPatchInterpolation.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "PatchToPatchInterpolation.H"
00032 #include "demandDrivenData.H"
00033
00034
00035
00036 namespace Foam
00037 {
00038
00039
00040
00041 template<class FromPatch, class ToPatch>
00042 const scalar
00043 PatchToPatchInterpolation<FromPatch, ToPatch>::directHitTol = 1e-5;
00044
00045
00046
00047 template<class FromPatch, class ToPatch>
00048 const labelList&
00049 PatchToPatchInterpolation<FromPatch, ToPatch>::pointAddr() const
00050 {
00051 if (!pointAddressingPtr_)
00052 {
00053 calcPointAddressing();
00054 }
00055
00056 return *pointAddressingPtr_;
00057 }
00058
00059
00060 template<class FromPatch, class ToPatch>
00061 const FieldField<Field, scalar>&
00062 PatchToPatchInterpolation<FromPatch, ToPatch>::pointWeights() const
00063 {
00064 if (!pointWeightsPtr_)
00065 {
00066 calcPointAddressing();
00067 }
00068
00069 return *pointWeightsPtr_;
00070 }
00071
00072
00073 template<class FromPatch, class ToPatch>
00074 const labelList&
00075 PatchToPatchInterpolation<FromPatch, ToPatch>::faceAddr() const
00076 {
00077 if (!faceAddressingPtr_)
00078 {
00079 calcFaceAddressing();
00080 }
00081
00082 return *faceAddressingPtr_;
00083 }
00084
00085
00086 template<class FromPatch, class ToPatch>
00087 const FieldField<Field, scalar>&
00088 PatchToPatchInterpolation<FromPatch, ToPatch>::faceWeights() const
00089 {
00090 if (!faceWeightsPtr_)
00091 {
00092 calcFaceAddressing();
00093 }
00094
00095 return *faceWeightsPtr_;
00096 }
00097
00098
00099 template<class FromPatch, class ToPatch>
00100 void PatchToPatchInterpolation<FromPatch, ToPatch>::clearOut()
00101 {
00102 deleteDemandDrivenData(pointAddressingPtr_);
00103 deleteDemandDrivenData(pointWeightsPtr_);
00104 deleteDemandDrivenData(pointDistancePtr_);
00105 deleteDemandDrivenData(faceAddressingPtr_);
00106 deleteDemandDrivenData(faceWeightsPtr_);
00107 deleteDemandDrivenData(faceDistancePtr_);
00108 }
00109
00110
00111
00112
00113
00114 template<class FromPatch, class ToPatch>
00115 PatchToPatchInterpolation<FromPatch, ToPatch>::PatchToPatchInterpolation
00116 (
00117 const FromPatch& fromPatch,
00118 const ToPatch& toPatch,
00119 intersection::algorithm alg,
00120 const intersection::direction dir
00121 )
00122 :
00123 fromPatch_(fromPatch),
00124 toPatch_(toPatch),
00125 alg_(alg),
00126 dir_(dir),
00127 pointAddressingPtr_(NULL),
00128 pointWeightsPtr_(NULL),
00129 pointDistancePtr_(NULL),
00130 faceAddressingPtr_(NULL),
00131 faceWeightsPtr_(NULL),
00132 faceDistancePtr_(NULL)
00133 {}
00134
00135
00136
00137
00138 template<class FromPatch, class ToPatch>
00139 PatchToPatchInterpolation<FromPatch, ToPatch>::~PatchToPatchInterpolation()
00140 {
00141 clearOut();
00142 }
00143
00144
00145
00146
00147 template<class FromPatch, class ToPatch>
00148 const scalarField&
00149 PatchToPatchInterpolation<FromPatch, ToPatch>
00150 ::pointDistanceToIntersection() const
00151 {
00152 if (!pointDistancePtr_)
00153 {
00154 calcPointAddressing();
00155 }
00156
00157 return *pointDistancePtr_;
00158 }
00159
00160
00161 template<class FromPatch, class ToPatch>
00162 const scalarField&
00163 PatchToPatchInterpolation<FromPatch, ToPatch>
00164 ::faceDistanceToIntersection() const
00165 {
00166 if (!faceDistancePtr_)
00167 {
00168 calcFaceAddressing();
00169 }
00170
00171 return *faceDistancePtr_;
00172 }
00173
00174
00175 template<class FromPatch, class ToPatch>
00176 bool PatchToPatchInterpolation<FromPatch, ToPatch>::movePoints()
00177 {
00178 clearOut();
00179
00180 return true;
00181 }
00182
00183
00184
00185
00186 }
00187
00188
00189
00190 # include "CalcPatchToPatchWeights.C"
00191 # include "PatchToPatchInterpolate.C"
00192
00193
Copyright © 2000-2009 OpenCFD Ltd