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