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 "transformFieldField.H"
00031
00032
00033
00034 namespace Foam
00035 {
00036
00037
00038
00039 template<template<class> class Field, class Type>
00040 void transform
00041 (
00042 FieldField<Field, Type>& rtf,
00043 const FieldField<Field, tensor>& trf,
00044 const FieldField<Field, Type>& tf
00045 )
00046 {
00047 forAll(rtf, i)
00048 {
00049 transform(rtf[i], trf[i], tf[i]);
00050 }
00051 }
00052
00053
00054 template<template<class> class Field, class Type>
00055 tmp<FieldField<Field, Type> > transform
00056 (
00057 const FieldField<Field, tensor>& trf,
00058 const FieldField<Field, Type>& tf
00059 )
00060 {
00061 tmp<FieldField<Field, Type> > tranf
00062 (
00063 FieldField<Field, Type>::NewCalculatedType(tf)
00064 );
00065 transform(tranf(), trf, tf);
00066 return tranf;
00067 }
00068
00069
00070 template<template<class> class Field, class Type>
00071 tmp<FieldField<Field, Type> > transform
00072 (
00073 const FieldField<Field, tensor>& trf,
00074 const tmp<FieldField<Field, Type> >& ttf
00075 )
00076 {
00077 tmp<FieldField<Field, Type> > tranf(ttf.ptr());
00078 transform(tranf(), trf, tranf());
00079 return tranf;
00080 }
00081
00082
00083 template<template<class> class Field, class Type>
00084 tmp<FieldField<Field, Type> > transform
00085 (
00086 const tmp<FieldField<Field, tensor> >& ttrf,
00087 const FieldField<Field, Type>& tf
00088 )
00089 {
00090 tmp<FieldField<Field, Type> > tranf
00091 (
00092 FieldField<Field, Type>::NewCalculatedType(tf)
00093 );
00094 transform(tranf(), ttrf(), tf);
00095 ttrf.clear();
00096 return tranf;
00097 }
00098
00099
00100 template<template<class> class Field, class Type>
00101 tmp<FieldField<Field, Type> > transform
00102 (
00103 const tmp<FieldField<Field, tensor> >& ttrf,
00104 const tmp<FieldField<Field, Type> >& ttf
00105 )
00106 {
00107 tmp<FieldField<Field, Type> > tranf(ttf.ptr());
00108 transform(tranf(), ttrf(), tranf());
00109 ttrf.clear();
00110 return tranf;
00111 }
00112
00113
00114 template<template<class> class Field, class Type>
00115 void transform
00116 (
00117 FieldField<Field, Type>& rtf,
00118 const tensor& t,
00119 const FieldField<Field, Type>& tf
00120 )
00121 {
00122 forAll(rtf, i)
00123 {
00124 transform(rtf[i], t, tf[i]);
00125 }
00126 }
00127
00128
00129 template<template<class> class Field, class Type>
00130 tmp<FieldField<Field, Type> > transform
00131 (
00132 const tensor& t,
00133 const FieldField<Field, Type>& tf
00134 )
00135 {
00136 tmp<FieldField<Field, Type> > tranf
00137 (
00138 FieldField<Field, Type>::NewCalculatedType(tf)
00139 );
00140 transform(tranf(), t, tf);
00141 return tranf;
00142 }
00143
00144
00145 template<template<class> class Field, class Type>
00146 tmp<FieldField<Field, Type> > transform
00147 (
00148 const tensor& t,
00149 const tmp<FieldField<Field, Type> >& ttf
00150 )
00151 {
00152 tmp<FieldField<Field, Type> > tranf(ttf.ptr());
00153 transform(tranf(), t, tranf());
00154 return tranf;
00155 }
00156
00157
00158
00159
00160 }
00161
00162