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
00039
00040
00041
00042 #ifndef coordinateSystem_H
00043 #define coordinateSystem_H
00044
00045 #include "vector.H"
00046 #include "tensor.H"
00047 #include "vectorField.H"
00048 #include "tmp.H"
00049 #include "coordinateRotation.H"
00050 #include "mathematicalConstants.H"
00051
00052
00053
00054 namespace Foam
00055 {
00056
00057
00058
00059
00060
00061 class coordinateSystem
00062 {
00063
00064
00065
00066 word name_;
00067
00068
00069 vector origin_;
00070
00071
00072 vector axis_;
00073
00074
00075 vector dir_;
00076
00077
00078 public:
00079
00080
00081 TypeName("coordinateSystem");
00082
00083
00084
00085
00086
00087 coordinateSystem
00088 (
00089 const word& name,
00090 const vector& origin,
00091 const vector& axis,
00092 const vector& dir
00093 );
00094
00095
00096 coordinateSystem
00097 (
00098 const word& name,
00099 const vector& origin,
00100 const coordinateRotation& cr
00101 );
00102
00103
00104 coordinateSystem(const word& name, const dictionary& dict);
00105
00106
00107
00108
00109 declareRunTimeSelectionTable
00110 (
00111 autoPtr,
00112 coordinateSystem,
00113 origAxisDir,
00114 (
00115 const word& name,
00116 const vector& origin,
00117 const vector& axis,
00118 const vector& dir
00119 ),
00120 (name, origin, axis, dir)
00121 );
00122
00123 declareRunTimeSelectionTable
00124 (
00125 autoPtr,
00126 coordinateSystem,
00127 origRotation,
00128 (
00129 const word& name,
00130 const vector& origin,
00131 const coordinateRotation& cr
00132 ),
00133 (name, origin, cr)
00134 );
00135
00136 declareRunTimeSelectionTable
00137 (
00138 autoPtr,
00139 coordinateSystem,
00140 dictionary,
00141 (
00142 const word& name,
00143 const dictionary& dict
00144 ),
00145 (name, dict)
00146 );
00147
00148
00149
00150
00151
00152 static autoPtr<coordinateSystem> New
00153 (
00154 const word& coordType,
00155 const word& name,
00156 const vector& origin,
00157 const vector& axis,
00158 const vector& dir
00159 );
00160
00161
00162 static autoPtr<coordinateSystem> New
00163 (
00164 const word& coordType,
00165 const word& name,
00166 const vector& origin,
00167 const coordinateRotation& cr
00168 );
00169
00170
00171 static autoPtr<coordinateSystem> New
00172 (
00173 const word& name,
00174 const dictionary& dict
00175 );
00176
00177
00178
00179
00180 virtual ~coordinateSystem();
00181
00182
00183
00184
00185
00186 const word& name() const
00187 {
00188 return name_;
00189 }
00190
00191
00192 const vector& origin() const
00193 {
00194 return origin_;
00195 }
00196
00197
00198 const vector& axis() const
00199 {
00200 return axis_;
00201 }
00202
00203
00204 const vector& direction() const
00205 {
00206 return dir_;
00207 }
00208
00209
00210
00211 virtual vector toGlobal(const vector& localV) const = 0;
00212
00213 virtual tmp<vectorField> toGlobal(const vectorField& localV) const = 0;
00214
00215
00216 virtual vector toLocal(const vector& globalV) const = 0;
00217
00218 virtual tmp<vectorField> toLocal(const vectorField& globalV) const = 0;
00219
00220
00221 virtual void write(Ostream&) const;
00222
00223
00224 virtual void writeDict(Ostream&) const;
00225
00226
00227
00228
00229 friend Ostream& operator<<(Ostream&, const coordinateSystem&);
00230 };
00231
00232
00233
00234
00235 }
00236
00237
00238
00239 #endif
00240
00241