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();
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable, so the various sorted methods should be used if traversing in parallel.
IOobjectList lookupClass(const char *clsName) const
The list of IOobjects with the given headerClassName.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const fileName & facesInstance() const
Return the current instance directory for faces.
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
constexpr char nl
The newline '\n' character (0x0a)
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelList & patchID() const
Per boundary face label the patch index.
Generic dimensioned Type class.
#define forAll(list, i)
Loop across all elements in list.
Generic templated field type.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
label nInternalFaces() const noexcept
Number of internal faces.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
void setSize(const label newLen)
Same as resize()
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))
instantList times() const
Search the case for valid time directories.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
Automatically write from objectRegistry::writeObject()
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Defines the attributes of an object for which implicit objectRegistry management is supported...
forAllConstIters(mixture.phases(), phase)
static constexpr const zero Zero
Global zero (0)