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;
181 "pointDualAddressing",
189 if (pointDualAddressing.size() != tetDualMesh.
nPoints())
192 <<
"Size " << pointDualAddressing.size()
193 <<
" of addressing map " 194 << pointDualAddressing.relativeObjectPath()
195 <<
" differs from number of points in mesh " 203 label nPatchFaces = 0;
205 forAll(pointDualAddressing, pointi)
207 label index = pointDualAddressing[pointi];
219 label facei = -index-1;
223 <<
"Face " << facei <<
" from index " << index
224 <<
" is not a boundary face." 238 Info<<
"tetDualMesh points : " << tetDualMesh.
nPoints()
239 <<
" of which mapped to" <<
nl 240 <<
" cells : " << nCells <<
nl 241 <<
" patch faces : " << nPatchFaces <<
nl 242 <<
" not mapped : " << nUnmapped <<
nl 251 ReadAndMapFields<volScalarField, pointScalarField>
262 ReadAndMapFields<volVectorField, pointVectorField>
273 ReadAndMapFields<volSphericalTensorField, pointSphericalTensorField>
284 ReadAndMapFields<volSymmTensorField, pointSymmTensorField>
295 ReadAndMapFields<volTensorField, pointTensorField>
305 tetDualMesh.objectRegistry::write();
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
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.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
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.
Generic dimensioned Type class.
Pre-declare SubField and related Field type.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
if(fields) ReadFields(pointMesh PtrList< pointVectorField > pvFlds
static pointMesh & New(polyMesh &mesh)
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.
PtrList< pointScalarField > psFlds
if(fields) ReadFields(pointMesh PtrList< pointSphericalTensorField > pstFlds
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...