Go to the documentation of this file.
51 bool notEqual(
const scalar s1,
const scalar s2,
const scalar tol)
53 return mag(s1-s2) > tol;
58 int main(
int argc,
char *argv[])
73 Info<<
"Splitting/deleting cells using inflation/deflation" <<
nl
78 Info<<
"Splitting/deleting cells, introducing points at new position"
106 zeroGradientFvPatchScalarField::typeName
108 Info<<
"Writing one field "
109 <<
one.name() <<
" in " << runTime.timeName() <<
endl;
126 Info<<
"Writing x component of cell centres to "
128 <<
" in " << runTime.timeName() <<
endl;
145 calculatedFvsPatchScalarField::typeName
147 Info<<
"Writing surface one field "
148 << surfaceOne.name() <<
" in " << runTime.timeName() <<
endl;
165 calculatedPointPatchScalarField::typeName
169 Info<<
"Writing x-component field "
170 << pointX.name() <<
" in " << runTime.timeName() <<
endl;
184 while (runTime.loop())
186 Info<<
"Time = " << runTime.timeName() <<
nl <<
endl;
206 else if (action == 1 || action == 2)
217 for (
label i=0; i<nRefine; i++)
230 Info<<
nl <<
"-- selected "
233 <<
" for refinement" <<
endl;
243 label nUnrefine = allSplitPoints.
size()/20;
246 for (
label i=0; i<nUnrefine; i++)
249 candidates.
insert(allSplitPoints[index]);
257 Info<<
nl <<
"-- selected "
261 <<
" for unrefinement" <<
endl;
264 meshCutter.setUnrefinement(splitPoints, meshMod);
271 Info<<
nl <<
"-- actually changing mesh" <<
endl;
279 if (map().hasMotionPoints())
286 Info<<
nl <<
"-- mapping hexRef8 data" <<
endl;
313 <<
"Volume not mapped. V:" <<
mesh.
V().size()
319 Info<<
"Initial volume = " << totalVol
320 <<
" New volume = " << newVol
323 if (
mag(newVol-totalVol)/totalVol > 1
e-10)
326 <<
"Volume loss: old volume:" << totalVol
327 <<
" new volume:" << newVol
342 Info<<
"Uniform one field min = " <<
min
348 <<
"Uniform volVectorField not preserved."
349 <<
" Min and max should both be 1.0. min:" <<
min
355 Info<<
"Uniform field mapping check OK" <<
nl <<
endl;
366 Info<<
"Linear profile field min = " <<
min
371 Info<<
"Linear profile not preserved."
372 <<
" Min and max should both be 0.0. min:" <<
min
377 Info<<
"Linear profile mapping check OK" <<
nl <<
endl;
382 if (surfaceOne.size())
387 Info<<
"Uniform surface field min = " <<
min
393 <<
"Uniform surfaceScalarField not preserved."
394 <<
" Min and max should both be 1.0. min:" <<
min
400 Info<<
"Uniform surfaceScalarField mapping check OK" <<
nl
406 Info<<
"ExecutionTime = " << runTime.elapsedCpuTime() <<
" s"
407 <<
" ClockTime = " << runTime.elapsedClockTime() <<
" s"
static SLList< string > validArgs
A list of valid (mandatory) arguments.
vectorField pointField
pointField is a vectorField.
bool changing() const
Is mesh changing (topology changing and/or moving)
Simple random number generator.
virtual const pointField & points() const
Return raw points.
bool topoChanging() const
Is mesh topology changing.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
int main(int argc, char *argv[])
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
const stringList & args() const
Return arguments.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
List< Key > toc() const
Return the table of contents.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
bool moving() const
Is mesh moving.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label nTotalCells() const
Return total number of cells in decomposed mesh.
Calculate the divergence of the given field.
A class representing the concept of 1 (scalar(1.0)) used to avoid unnecessary manipulations for objec...
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
dimensioned< scalar > mag(const dimensioned< Type > &)
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
static const pointConstraints & New(const pointMesh &mesh)
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
virtual Ostream & write(const token &)=0
Write next token to stream.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
InternalField & internalField()
Return internal field.
const labelList & patchPatchPointConstraintPoints() const
Mesh points on which to apply special constraints.
Generic dimensioned Type class.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
const double e
Elementary charge.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void correctBoundaryConditions()
Correct boundary field.
Application of (multi-)patch point contraints.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const volVectorField & C() const
Return cell centres as volVectorField.
Refinement of (split) hexes using polyTopoChange.
void setRefinement(const cellCuts &cuts, polyTopoChange &meshMod)
Do actual cutting with cut description. Inserts mesh changes.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool insert(const Key &key)
Insert a new entry.
void size(const label)
Override size to be inconsistent with allocated storage.
Type gMin(const FieldField< Field, Type > &f)
const globalMeshData & globalData() const
Return parallel info.
Generic GeometricField class.
Foam::argList args(argc, argv)
bool notEqual(const Scalar s1, const Scalar s2)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
cachedRandom rndGen(label(0), -1)
Type gMax(const FieldField< Field, Type > &f)