Go to the documentation of this file.
48 template<
class ReadGeoField,
class MappedGeoField>
55 const typename MappedGeoField::value_type& nullValue,
59 typedef typename MappedGeoField::value_type Type;
64 tetFields.
setSize(fieldObjects.size());
69 Info<<
"Converting " << ReadGeoField::typeName <<
' ' << iter.key()
72 ReadGeoField readField(*iter(),
mesh);
87 readField.registerObject()
97 fld.setSize(map.size(), nullValue);
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();
143 int main(
int argc,
char *argv[])
147 "Convert polyMesh results to tetDualMesh"
164 Info<<
"Create tetDualMesh for time = "
182 "pointDualAddressing",
190 if (pointDualAddressing.size() != tetDualMesh.
nPoints())
193 <<
"Size " << pointDualAddressing.size()
194 <<
" of addressing map " << pointDualAddressing.objectPath()
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();
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static constexpr const zero Zero
Global zero (0)
label nInternalFaces() const
Number of internal faces.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
static word timeName(const scalar t, const int precision=precision_)
static void addNote(const string ¬e)
Add extra notes for the usage information.
const fileName & facesInstance() const
Return the current instance directory for faces.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAll(list, i)
Loop across all elements in list.
const labelList & patchID() const
Per boundary face label the patch index.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Generic templated field type.
messageStream Info
Information stream (uses stdout - output is on the master only)
instantList times() const
Search the case for valid time directories.
void setSize(const label newLen)
Same as resize()
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
forAllConstIters(mixture.phases(), phase)
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
label nPoints() const
Number of mesh points.
IOobjectList lookupClass(const char *clsName) const
The list of IOobjects with the given headerClassName.