44 template<
class ReadGeoField,
class MappedGeoField>
51 const typename MappedGeoField::value_type& nullValue,
55 typedef typename MappedGeoField::value_type Type;
60 tetFields.
setSize(fieldObjects.size());
65 Info<<
"Converting " << ReadGeoField::typeName <<
' ' << iter.key()
68 ReadGeoField readField(*iter(), mesh);
83 readField.registerObject()
89 readField.dimensions(),
98 fld.setSize(map.
size(), nullValue);
101 label index = map[pointi];
105 label celli = index-1;
106 fld[pointi] = readField[celli];
110 label facei = -index-1;
119 fld[pointi] = readField.boundaryField()[
patchi][localFacei];
137 tetFields[i].correctBoundaryConditions();
146 int main(
int argc,
char *argv[])
157 Info<<
"Create tetDualMesh for time = "
158 << runTime.name() <<
nl <<
endl;
176 "pointDualAddressing",
184 if (pointDualAddressing.size() != tetDualMesh.
nPoints())
187 <<
"Size " << pointDualAddressing.size()
188 <<
" of addressing map "
189 << pointDualAddressing.relativeObjectPath()
190 <<
" differs from number of points in mesh "
198 label nPatchFaces = 0;
200 forAll(pointDualAddressing, pointi)
202 label index = pointDualAddressing[pointi];
214 label facei = -index-1;
218 <<
"Face " << facei <<
" from index " << index
219 <<
" is not a boundary face."
233 Info<<
"tetDualMesh points : " << tetDualMesh.
nPoints()
234 <<
" of which mapped to" <<
nl
235 <<
" cells : " << nCells <<
nl
236 <<
" patch faces : " << nPatchFaces <<
nl
237 <<
" not mapped : " << nUnmapped <<
nl
246 ReadAndMapFields<volScalarField, pointScalarField>
257 ReadAndMapFields<volVectorField, pointVectorField>
268 ReadAndMapFields<volSphericalTensorField, pointSphericalTensorField>
279 ReadAndMapFields<volSymmTensorField, pointSymmTensorField>
290 ReadAndMapFields<volTensorField, pointTensorField>
300 tetDualMesh.objectRegistry::write();
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Pre-declare SubField and related Field type.
List of IOobjects with searching and retrieving facilities.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void size(const label)
Override size to be inconsistent with allocated storage.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
const labelList & patchIndices() const
Boundary face patch indices.
const fileName & facesInstance() const
Return the current instance directory for faces.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
label nInternalFaces() const
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
if(fields) ReadFields(pointMesh PtrList< pointVectorField > pvFlds
PtrList< pointScalarField > psFlds
if(fields) ReadFields(pointMesh PtrList< pointSphericalTensorField > pstFlds
if(fields) ReadFields(pointMesh PtrList< pointTensorField > ptFlds
Foam::argList args(argc, argv)