pointFieldDecomposerDecomposeFields.C
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 #include "pointFieldDecomposer.H"
00028 #include "processorPointPatchFields.H"
00029 #include "globalPointPatchFields.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035
00036
00037
00038 template<class Type>
00039 tmp<GeometricField<Type, pointPatchField, pointMesh> >
00040 pointFieldDecomposer::decomposeField
00041 (
00042 const GeometricField<Type, pointPatchField, pointMesh>& field
00043 ) const
00044 {
00045
00046 Field<Type> internalField(field.internalField(), pointAddressing_);
00047
00048
00049
00050 PtrList<pointPatchField<Type> > patchFields
00051 (
00052 boundaryAddressing_.size() + 1
00053 );
00054
00055
00056 forAll (boundaryAddressing_, patchi)
00057 {
00058 if (patchFieldDecomposerPtrs_[patchi])
00059 {
00060 patchFields.set
00061 (
00062 patchi,
00063 pointPatchField<Type>::New
00064 (
00065 field.boundaryField()[boundaryAddressing_[patchi]],
00066 procMesh_.boundary()[patchi],
00067 DimensionedField<Type, pointMesh>::null(),
00068 *patchFieldDecomposerPtrs_[patchi]
00069 )
00070 );
00071 }
00072 else
00073 {
00074 patchFields.set
00075 (
00076 patchi,
00077 new processorPointPatchField<Type>
00078 (
00079 procMesh_.boundary()[patchi],
00080 DimensionedField<Type, pointMesh>::null()
00081 )
00082 );
00083 }
00084 }
00085
00086
00087 patchFields.set
00088 (
00089 boundaryAddressing_.size(),
00090 new globalPointPatchField<Type>
00091 (
00092 procMesh_.boundary().globalPatch(),
00093 DimensionedField<Type, pointMesh>::null()
00094 )
00095 );
00096
00097
00098 return tmp<GeometricField<Type, pointPatchField, pointMesh> >
00099 (
00100 new GeometricField<Type, pointPatchField, pointMesh>
00101 (
00102 IOobject
00103 (
00104 field.name(),
00105 procMesh_().time().timeName(),
00106 procMesh_(),
00107 IOobject::NO_READ,
00108 IOobject::NO_WRITE
00109 ),
00110 procMesh_,
00111 field.dimensions(),
00112 internalField,
00113 patchFields
00114 )
00115 );
00116 }
00117
00118
00119 template<class GeoField>
00120 void pointFieldDecomposer::decomposeFields
00121 (
00122 const PtrList<GeoField>& fields
00123 ) const
00124 {
00125 forAll (fields, fieldI)
00126 {
00127 decomposeField(fields[fieldI])().write();
00128 }
00129 }
00130
00131
00132
00133
00134 }
00135
00136
Copyright © 2000-2009 OpenCFD Ltd