49 template<
class ReadGeoField,
class MappedGeoField>
56 const typename MappedGeoField::value_type& nullValue,
60 typedef typename MappedGeoField::value_type Type;
68 tetFields.
resize(fieldObjects.size());
74 << ReadGeoField::typeName <<
' ' <<
io.
name() <<
endl;
76 ReadGeoField readField(
io,
mesh);
91 readField.registerObject()
101 fld.setSize(map.
size(), nullValue);
104 label index = map[pointi];
108 label celli = index-1;
109 fld[pointi] = readField[celli];
113 const label facei = -index-1;
121 fld[pointi] = readField.boundaryField()[patchi][localFacei];
139 tetFields[i].correctBoundaryConditions();
146 int main(
int argc,
char *argv[])
150 "Convert polyMesh results to tetDualMesh" 167 Info<<
"Create tetDualMesh for time = " 185 "pointDualAddressing",
193 if (pointDualAddressing.size() != tetDualMesh.
nPoints())
196 <<
"Size " << pointDualAddressing.size()
197 <<
" of addressing map " << pointDualAddressing.objectPath()
198 <<
" differs from number of points in mesh " 206 label nPatchFaces = 0;
208 forAll(pointDualAddressing, pointi)
210 label index = pointDualAddressing[pointi];
222 label facei = -index-1;
226 <<
"Face " << facei <<
" from index " << index
227 <<
" is not a boundary face." 241 Info<<
"tetDualMesh points : " << tetDualMesh.
nPoints()
242 <<
" of which mapped to" <<
nl 243 <<
" cells : " << nCells <<
nl 244 <<
" patch faces : " << nPatchFaces <<
nl 245 <<
" not mapped : " << nUnmapped <<
nl 254 ReadAndMapFields<volScalarField, pointScalarField>
265 ReadAndMapFields<volVectorField, pointVectorField>
276 ReadAndMapFields<volSphericalTensorField, pointSphericalTensorField>
287 ReadAndMapFields<volSymmTensorField, pointSymmTensorField>
298 ReadAndMapFields<volTensorField, pointTensorField>
308 tetDualMesh.objectRegistry::write();
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.
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.
const word & name() const noexcept
Return the object name.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject. Registered with typeName.
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.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
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.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
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 a time name for the given scalar time value formatted with the given precision.
void resize(const label newLen)
Adjust size of PtrList.
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)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
UPtrList< const IOobject > csorted() const
The sorted list of IOobjects with headerClassName == Type::typeName.
static constexpr const zero Zero
Global zero (0)