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[])
162 Info<<
"Create tetDualMesh for time = " 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 polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool set(const label) const
Is element set.
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.
if(fields) ReadFields(pointMesh PtrList< pointTensorField > ptFlds
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
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.
const labelList & patchID() const
Per boundary face label the patch index.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Generic dimensioned Type class.
static const pointMesh & New(const polyMesh &mesh)
Pre-declare SubField and related Field type.
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
if(fields) ReadFields(pointMesh PtrList< pointVectorField > pvFlds
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
IOobjectList lookupClass(const word &className) const
Return the list for all IOobjects of a given class.
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.
instantList times() const
Search the case for valid time directories.
PtrList< pointScalarField > psFlds
if(fields) ReadFields(pointMesh PtrList< pointSphericalTensorField > pstFlds
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...