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
00032
00033
00034
00035
00036
00037
00038 #ifndef coupledFaPatch_H
00039 #define coupledFaPatch_H
00040
00041 #include "faPatch.H"
00042
00043
00044
00045 namespace Foam
00046 {
00047
00048
00049
00050
00051
00052 class coupledFaPatch
00053 :
00054 public faPatch
00055 {
00056
00057
00058
00059 mutable vectorField separation_;
00060
00061
00062 mutable tensorField forwardT_;
00063
00064
00065 mutable tensorField reverseT_;
00066
00067
00068 protected:
00069
00070
00071 void calcTransformTensors
00072 (
00073 const vector& Cf,
00074 const vector& Cr,
00075 const vector& nf,
00076 const vector& nr
00077 ) const;
00078
00079
00080 void calcTransformTensors
00081 (
00082 const vectorField& Cf,
00083 const vectorField& Cr,
00084 const vectorField& nf,
00085 const vectorField& nr
00086 ) const;
00087
00088
00089 public:
00090
00091
00092 TypeName("coupled");
00093
00094
00095
00096
00097
00098 coupledFaPatch
00099 (
00100 const word& name,
00101 const dictionary& dict,
00102 const label index,
00103 const faBoundaryMesh& bm
00104 )
00105 :
00106 faPatch(name, dict, index, bm)
00107 {}
00108
00109
00110
00111
00112 virtual ~coupledFaPatch();
00113
00114
00115
00116
00117
00118
00119
00120 virtual bool coupled() const
00121 {
00122 return true;
00123 }
00124
00125
00126
00127 bool separated() const
00128 {
00129 return separation_.size();
00130 }
00131
00132
00133
00134 const vectorField& separation() const
00135 {
00136 if (!separation_.size())
00137 {
00138 FatalErrorIn("coupledFaPatch::separation() const")
00139 << "Coupled patches are not separated"
00140 << abort(FatalError);
00141 }
00142
00143 return separation_;
00144 }
00145
00146
00147
00148 bool parallel() const
00149 {
00150 return forwardT_.size() == 0;
00151 }
00152
00153
00154 const tensorField& forwardT() const
00155 {
00156 if (!forwardT_.size())
00157 {
00158 FatalErrorIn("coupledFaPatch::forwardT() const")
00159 << "Coupled planes do not need transformation"
00160 << abort(FatalError);
00161 }
00162
00163 return forwardT_;
00164 }
00165
00166
00167 const tensorField& reverseT() const
00168 {
00169 if (!reverseT_.size())
00170 {
00171 FatalErrorIn("coupledFaPatch::forwardT() const")
00172 << "Coupled planes do not need transformation"
00173 << abort(FatalError);
00174 }
00175
00176 return reverseT_;
00177 }
00178
00179
00180 virtual void initGeometry() = 0;
00181
00182
00183 virtual void calcGeometry() = 0;
00184
00185
00186 virtual void initMovePoints(const pointField&) = 0;
00187
00188
00189 virtual void movePoints(const pointField&) = 0;
00190
00191
00192
00193
00194
00195 virtual void makeDeltaCoeffs(scalarField&) const = 0;
00196
00197
00198 virtual tmp<vectorField> delta() const = 0;
00199 };
00200
00201
00202
00203
00204 }
00205
00206
00207
00208 #endif
00209
00210