43 template<
class ReadGeoField,
class MappedGeoField>
50 const typename MappedGeoField::value_type& nullValue,
54 typedef typename MappedGeoField::value_type Type;
59 tetFields.
setSize(fieldObjects.size());
64 Info<<
"Converting " << ReadGeoField::typeName <<
' ' << iter.key()
67 ReadGeoField readField(*iter(), mesh);
82 readField.registerObject()
88 readField.dimensions(),
94 Field<Type>& fld = tetFields[i].primitiveFieldRef();
100 label index = map[pointi];
104 label celli = index-1;
105 fld[pointi] = readField[celli];
109 label facei = -index-1;
118 fld[pointi] = readField.boundaryField()[
patchi][localFacei];
136 tetFields[i].correctBoundaryConditions();
145 int main(
int argc,
char *argv[])
155 runTime.setTime(Times[startTime], startTime);
162 Info<<
"Create tetDualMesh for time = " 163 << runTime.timeName() <<
nl <<
endl;
180 "pointDualAddressing",
188 if (pointDualAddressing.size() != tetDualMesh.
nPoints())
191 <<
"Size " << pointDualAddressing.size()
192 <<
" of addressing map " << pointDualAddressing.objectPath()
193 <<
" differs from number of points in mesh " 201 label nPatchFaces = 0;
203 forAll(pointDualAddressing, pointi)
205 label index = pointDualAddressing[pointi];
217 label facei = -index-1;
221 <<
"Face " << facei <<
" from index " << index
222 <<
" is not a boundary face." 236 Info<<
"tetDualMesh points : " << tetDualMesh.
nPoints()
237 <<
" of which mapped to" <<
nl 238 <<
" cells : " << nCells <<
nl 239 <<
" patch faces : " << nPatchFaces <<
nl 240 <<
" not mapped : " << nUnmapped <<
nl 249 ReadAndMapFields<volScalarField, pointScalarField>
260 ReadAndMapFields<volVectorField, pointVectorField>
271 ReadAndMapFields<volSphericalTensorField, pointSphericalTensorField>
282 ReadAndMapFields<volSymmTensorField, pointSymmTensorField>
293 ReadAndMapFields<volTensorField, pointTensorField>
303 tetDualMesh.objectRegistry::write();
const labelList & patchID() const
Per boundary face label the patch index.
#define forAll(list, i)
Loop across all elements in list.
IOobjectList lookupClass(const word &className) const
Return the list for all IOobjects of a given class.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const fileName & facesInstance() const
Return the current instance directory for faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic dimensioned Type class.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
static const pointMesh & New(const polyMesh &mesh)
Pre-declare SubField and related Field type.
bool set(const label) const
Is element set.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void setSize(const label)
Reset size of List.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Mesh data needed to do the Finite Volume discretisation.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label nInternalFaces() const