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 "transformGeometricField.H"
00031 #include "transformField.H"
00032 #include "transformFieldField.H"
00033
00034
00035
00036 namespace Foam
00037 {
00038
00039
00040
00041 template<class Type, template<class> class PatchField, class GeoMesh>
00042 void transform
00043 (
00044 GeometricField<Type, PatchField, GeoMesh>& rtf,
00045 const GeometricField<tensor, PatchField, GeoMesh>& trf,
00046 const GeometricField<Type, PatchField, GeoMesh>& tf
00047 )
00048 {
00049 transform(rtf.internalField(), trf.internalField(), tf.internalField());
00050 transform(rtf.boundaryField(), trf.boundaryField(), tf.boundaryField());
00051 }
00052
00053
00054 template<class Type, template<class> class PatchField, class GeoMesh>
00055 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
00056 (
00057 const GeometricField<tensor, PatchField, GeoMesh>& trf,
00058 const GeometricField<Type, PatchField, GeoMesh>& tf
00059 )
00060 {
00061 tmp<GeometricField<Type, PatchField, GeoMesh> > tranf
00062 (
00063 new GeometricField<Type, PatchField, GeoMesh>
00064 (
00065 IOobject
00066 (
00067 "transform(" + trf.name() + ',' + tf.name() + ')',
00068 tf.instance(),
00069 tf.db(),
00070 IOobject::NO_READ,
00071 IOobject::NO_WRITE
00072 ),
00073 tf.mesh(),
00074 tf.dimensions()
00075 )
00076 );
00077
00078 transform(tranf(), trf, tf);
00079
00080 return tranf;
00081 }
00082
00083
00084 template<class Type, template<class> class PatchField, class GeoMesh>
00085 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
00086 (
00087 const GeometricField<tensor, PatchField, GeoMesh>& trf,
00088 const tmp<GeometricField<Type, PatchField, GeoMesh> >& ttf
00089 )
00090 {
00091 tmp<GeometricField<Type, PatchField, GeoMesh> > tranf =
00092 transform(trf, ttf());
00093 ttf.clear();
00094 return tranf;
00095 }
00096
00097
00098 template<class Type, template<class> class PatchField, class GeoMesh>
00099 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
00100 (
00101 const tmp<GeometricField<tensor, PatchField, GeoMesh> >& ttrf,
00102 const GeometricField<Type, PatchField, GeoMesh>& tf
00103 )
00104 {
00105 tmp<GeometricField<Type, PatchField, GeoMesh> > tranf =
00106 transform(ttrf(), tf);
00107 ttrf.clear();
00108 return tranf;
00109 }
00110
00111
00112 template<class Type, template<class> class PatchField, class GeoMesh>
00113 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
00114 (
00115 const tmp<GeometricField<tensor, PatchField, GeoMesh> >& ttrf,
00116 const tmp<GeometricField<Type, PatchField, GeoMesh> >& ttf
00117 )
00118 {
00119 tmp<GeometricField<Type, PatchField, GeoMesh> > tranf =
00120 transform(ttrf(), ttf());
00121 ttf.clear();
00122 ttrf.clear();
00123 return tranf;
00124 }
00125
00126
00127 template<class Type, template<class> class PatchField, class GeoMesh>
00128 void transform
00129 (
00130 GeometricField<Type, PatchField, GeoMesh>& rtf,
00131 const dimensionedTensor& t,
00132 const GeometricField<Type, PatchField, GeoMesh>& tf
00133 )
00134 {
00135 transform(rtf.internalField(), t.value(), tf.internalField());
00136 transform(rtf.boundaryField(), t.value(), tf.boundaryField());
00137 }
00138
00139
00140 template<class Type, template<class> class PatchField, class GeoMesh>
00141 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
00142 (
00143 const dimensionedTensor& t,
00144 const GeometricField<Type, PatchField, GeoMesh>& tf
00145 )
00146 {
00147 tmp<GeometricField<Type, PatchField, GeoMesh> > tranf
00148 (
00149 new GeometricField<vector, PatchField, GeoMesh>
00150 (
00151 IOobject
00152 (
00153 "transform(" + t.name() + ',' + tf.name() + ')',
00154 tf.instance(),
00155 tf.db(),
00156 IOobject::NO_READ,
00157 IOobject::NO_WRITE
00158 ),
00159 tf.mesh(),
00160 tf.dimensions()
00161 )
00162 );
00163
00164 transform(tranf(), t, tf);
00165
00166 return tranf;
00167 }
00168
00169
00170 template<class Type, template<class> class PatchField, class GeoMesh>
00171 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
00172 (
00173 const dimensionedTensor& t,
00174 const tmp<GeometricField<Type, PatchField, GeoMesh> >& ttf
00175 )
00176 {
00177 tmp<GeometricField<Type, PatchField, GeoMesh> > tranf =
00178 transform(t, ttf());
00179 ttf.clear();
00180 return tranf;
00181 }
00182
00183
00184
00185
00186 }
00187
00188