39#define checkField(fld1, fld2, op) \
40if (&(fld1).mesh() != &(fld2).mesh()) \
42 FatalErrorInFunction \
43 << "Different mesh for fields " \
44 << (fld1).name() << " and " << (fld2).name() \
45 << " during operation " << op \
46 << abort(FatalError); \
52template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
53void Foam::GeometricField<Type, PatchField, GeoMesh>::readFields
58 Internal::readField(
dict,
"internalField");
60 boundaryField_.readField(*
this,
dict.subDict(
"boundaryField"));
64 if (
dict.readIfPresent(
"referenceLevel", refLevel))
67 this->
field() += refLevel;
70 forAll(boundaryField_, patchi)
72 boundaryField_[patchi] == boundaryField_[patchi] + refLevel;
78template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
79void Foam::GeometricField<Type, PatchField, GeoMesh>::readFields()
83 localIOdictionary::readContents
91 IOobjectOption::MUST_READ,
92 IOobjectOption::NO_WRITE,
93 IOobjectOption::NO_REGISTER
105template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
106bool Foam::GeometricField<Type, PatchField, GeoMesh>::readIfPresent()
108 if (this->isReadRequired())
111 <<
"The readOption MUST_READ or READ_MODIFIED"
112 <<
" suggests that a read constructor for field " << this->
name()
113 <<
" would be more appropriate." << endl;
117 this->isReadOptional()
118 && this->
template typeHeaderOk<this_type>(
true)
122 readOldTimeIfPresent();
131template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
132bool Foam::GeometricField<Type, PatchField, GeoMesh>::readOldTimeIfPresent()
140 IOobjectOption::LAZY_READ,
141 IOobjectOption::AUTO_WRITE,
142 this->registerObject()
147 field0.template typeHeaderOk<this_type>(
true)
151 <<
"Reading old time level for field" <<
nl << this->info() <<
endl;
153 field0Ptr_ = std::make_unique<this_type>(field0, this->
mesh());
158 field0Ptr_->oriented() = this->oriented();
160 field0Ptr_->timeIndex_ = timeIndex_ - 1;
162 if (!field0Ptr_->readOldTimeIfPresent())
164 field0Ptr_->oldTime();
176template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
182 const word& patchFieldType
190 <<
"Creating" <<
nl << this->
info() << endl;
196template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
208 boundaryField_(
mesh.
boundary(), *this, patchFieldTypes, actualPatchTypes)
217template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
224 const word& patchFieldType
227 Internal(
io,
mesh, value, dims, false,
FieldBase::unifiedGeometricField),
232 <<
"Creating" <<
nl << this->
info() << endl;
234 boundaryField_ == value;
240template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
251 Internal(
io,
mesh, value, dims, false,
FieldBase::unifiedGeometricField),
253 boundaryField_(
mesh.
boundary(), *this, patchFieldTypes, actualPatchTypes)
256 <<
"Creating" <<
nl << this->
info() << endl;
258 boundaryField_ == value;
264template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
270 const word& patchFieldType
284template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
306template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
310 const Internal& diField,
311 const PtrList<PatchField<Type>>& ptfl
314 Internal(
io, diField),
319 <<
"Copy construct from components" <<
nl << this->
info() << endl;
325template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
330 const PtrList<PatchField<Type>>& ptfl
333 Internal(
io, std::move(diField)),
338 <<
"Move construct from components" <<
nl << this->
info() << endl;
344template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
349 const PtrList<PatchField<Type>>& ptfl
352 Internal(
io, tfield),
357 <<
"Construct from tmp internalField" <<
nl << this->
info() << endl;
363template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
366 const Internal& diField,
367 const PtrList<PatchField<Type>>& ptfl
375 <<
"Copy construct from components" <<
nl << this->
info() << endl;
381template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
385 const PtrList<PatchField<Type>>& ptfl
388 Internal(std::move(diField)),
393 <<
"Move construct from components" <<
nl << this->
info() << endl;
399template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
406 const word& patchFieldType
409 Internal(
io,
mesh, dims, iField),
414 <<
"Copy construct from primitive field" <<
nl << this->
info() << endl;
420template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
427 const word& patchFieldType
430 Internal(
io,
mesh, dims, std::move(iField)),
435 <<
"Move construct from primitive field" <<
nl << this->
info() << endl;
441template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
448 const word& patchFieldType
451 Internal(
io,
mesh, dims, tfield),
456 <<
"Construct from tmp primitive field" <<
nl << this->
info() << endl;
462template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
469 const PtrList<PatchField<Type>>& ptfl
472 Internal(
io,
mesh, dims, iField),
477 <<
"Copy construct from components" <<
nl << this->
info() << endl;
483template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
490 const PtrList<PatchField<Type>>& ptfl
493 Internal(
io,
mesh, dims, std::move(iField)),
498 <<
"Move construct from components" <<
nl << this->
info() << endl;
504template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
511 const PtrList<PatchField<Type>>& ptfl
514 Internal(
io,
mesh, dims, tfield),
519 <<
"Construct from tmp internalField" <<
nl << this->
info() << endl;
525template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
530 const bool readOldTime
538 <<
"Read construct" <<
nl << this->
info() << endl;
545 <<
"Had readOption NO_READ for field "
546 << this->
name() <<
", but constructor always reads field!"
554 readOldTimeIfPresent();
558 <<
"Finishing read-construction" <<
nl << this->
info() << endl;
562template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
577 <<
"Finishing dictionary-construct" <<
nl << this->
info() << endl;
581template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
589 boundaryField_(*this, gf.boundaryField_)
592 <<
"Copy construct" <<
nl << this->
info() << endl;
596 field0Ptr_ = std::make_unique<this_type>(*gf.field0Ptr_);
603template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
606 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
609 Internal(tgf.constCast(), tgf.movable()),
611 boundaryField_(*this, tgf().boundaryField_)
614 <<
"Constructing from tmp" <<
nl << this->
info() << endl;
622template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
631 boundaryField_(*this, gf.boundaryField_)
634 <<
"Copy construct, resetting IO params" <<
nl
635 << this->
info() << endl;
639 field0Ptr_ = std::make_unique<this_type>
648template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
652 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
655 Internal(
io, tgf.constCast(), tgf.movable()),
657 boundaryField_(*this, tgf().boundaryField_)
660 <<
"Constructing from tmp resetting IO params" <<
nl
661 << this->
info() << endl;
669template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
676 Internal(newName, gf),
678 boundaryField_(*this, gf.boundaryField_)
681 <<
"Copy construct, resetting name" <<
nl
682 << this->
info() << endl;
686 field0Ptr_ = std::make_unique<this_type>
695template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
699 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
702 Internal(newName, tgf.constCast(), tgf.movable()),
704 boundaryField_(*this, tgf().boundaryField_)
707 <<
"Constructing from tmp resetting name" <<
nl
714template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
719 const word& patchFieldType
724 boundaryField_(this->
mesh().
boundary(), *this, patchFieldType)
727 <<
"Copy construct, resetting IO params" <<
nl
728 << this->
info() << endl;
730 boundaryField_ == gf.boundaryField_;
734 field0Ptr_ = std::make_unique<this_type>
743template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
747 const GeometricField<Type, PatchField, GeoMesh>& gf,
763 <<
"Copy construct, resetting IO params and patch types" <<
nl
764 << this->
info() << endl;
766 boundaryField_ == gf.boundaryField_;
770 field0Ptr_ = std::make_unique<this_type>
779template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
783 const GeometricField<Type, PatchField, GeoMesh>& gf,
785 const word& patchFieldType
790 boundaryField_(*this, gf.boundaryField_,
patchIDs, patchFieldType)
793 <<
"Copy construct, resetting IO params and setting patchFieldType "
794 <<
"for patchIDs" <<
nl
795 << this->
info() << endl;
799 field0Ptr_ = std::make_unique<this_type>
808template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
812 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf,
817 Internal(
io, tgf.constCast(), tgf.movable()),
828 <<
"Constructing from tmp resetting IO params and patch types" <<
nl
829 << this->
info() << endl;
831 boundaryField_ == tgf().boundaryField_;
837template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
847template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
867template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
872 const bool updateAccessTime
875 if (updateAccessTime)
884template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
889 const bool updateAccessTime
892 if (updateAccessTime)
901template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
906 const bool updateAccessTime
909 if (updateAccessTime)
914 return boundaryField_;
918template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
922 return (field0Ptr_ ? (field0Ptr_->nOldTimes() + 1) : 0);
926template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
932 && timeIndex_ != this->time().
timeIndex()
933 && !this->
name().ends_with(
"_0")
937 timeIndex_ = this->time().timeIndex();
945template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
950 field0Ptr_->storeOldTime();
953 <<
"Storing old time field for field" <<
nl << this->info() <<
endl;
955 *field0Ptr_ == *
this;
956 field0Ptr_->timeIndex_ = timeIndex_;
958 if (field0Ptr_->field0Ptr_)
960 field0Ptr_->writeOpt(this->writeOpt());
966template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
967const Foam::GeometricField<Type, PatchField, GeoMesh>&
972 field0Ptr_ = std::make_unique<this_type>
981 this->registerObject()
989 <<
"created old time field " << field0Ptr_->info() <<
endl;
1006template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1017template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1020 if (!fieldPrevIterPtr_)
1023 <<
"Allocating previous iteration field" <<
nl
1026 fieldPrevIterPtr_ = std::make_unique<this_type>
1028 this->
name() +
"PrevIter",
1034 *fieldPrevIterPtr_ == *
this;
1039template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1043 if (!fieldPrevIterPtr_)
1046 <<
"previous iteration field" <<
endl << this->
info() <<
endl
1048 <<
" Use field.storePrevIter() at start of iteration."
1052 return *fieldPrevIterPtr_;
1056template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1059 field0Ptr_.reset(
nullptr);
1060 fieldPrevIterPtr_.reset(
nullptr);
1064template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1070 this->setUpToDate();
1073 boundaryField_.evaluate();
1077template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1086 boundaryField_.evaluateLocal();
1090template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1095 const label meshSize = GeoMesh::size(this->
mesh());
1096 const label totalSize = GeoMesh::boundary_size(this->
mesh()) + meshSize;
1101 <<
"Problem : field:" << this->
name()
1102 <<
" size:" << this->
size()
1103 <<
" capacity:" << this->
capacity()
1104 <<
" is not mesh size:" << meshSize
1105 <<
" or total size:" << totalSize
1115 fld.reserve_exact(totalSize);
1116 fld.resize_copy(meshSize, totalSize);
1121 const label start = (meshSize + pfld.patch().offset());
1130template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1136 bool needRef =
true;
1138 for (
const auto& pf : boundaryField_)
1140 if (pf.fixesValue())
1151template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1161template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1166 if (this->
mesh().data().isFinalIteration())
1171 scalar relaxCoeff = 1;
1173 if (this->
mesh().relaxField(
name, relaxCoeff))
1180template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1188 return this->
name() +
"Final";
1191 return this->
name();
1195template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1204 os <<
"min/max(" << this->
name() <<
") = "
1209template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1224template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1242template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1271template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1288template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1300template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1311template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1322template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1332template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1342template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1358template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1374template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1386template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1397template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1408template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1418template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1426template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1436template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1451 internalFieldRef() = gf.internalField();
1457 [](
const auto& pfld) {
return pfld.constraintOverride(); }
1462template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1465 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
1468 const auto& gf = tgf();
1479 this->dimensions() = gf.dimensions();
1480 this->oriented() = gf.oriented();
1499 [](
const auto& pfld) {
return pfld.constraintOverride(); }
1504template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1507 const dimensioned<Type>& dt
1510 internalFieldRef() = dt;
1516 [](
const auto& pfld) {
return pfld.constraintOverride(); }
1521template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1531 [](
const auto& pfld) {
return pfld.constraintOverride(); }
1536template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1539 const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf
1542 const auto& gf = tgf();
1548 internalFieldRef() = gf.internalField();
1556 [](
const auto& pfld) {
return pfld.constraintOverride(); }
1561template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1564 const dimensioned<Type>& dt
1567 internalFieldRef() = dt;
1573 [](
const auto& pfld) {
return pfld.constraintOverride(); }
1578template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1588 [](
const auto& pfld) {
return pfld.constraintOverride(); }
1593#define COMPUTED_ASSIGNMENT(TYPE, op) \
1595template<class Type, template<class> class PatchField, class GeoMesh> \
1596void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
1598 const GeometricField<TYPE, PatchField, GeoMesh>& gf \
1601 checkField(*this, gf, #op); \
1603 internalFieldRef() op gf.internalField(); \
1604 boundaryFieldRef() op gf.boundaryField(); \
1606 boundaryFieldRef().evaluate_if \
1608 [](const auto& pfld) { return pfld.constraintOverride(); } \
1612template<class Type, template<class> class PatchField, class GeoMesh> \
1613void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
1615 const tmp<GeometricField<TYPE, PatchField, GeoMesh>>& tgf \
1618 operator op(tgf()); \
1621 boundaryFieldRef().evaluate_if \
1623 [](const auto& pfld) { return pfld.constraintOverride(); } \
1627template<class Type, template<class> class PatchField, class GeoMesh> \
1628void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
1630 const dimensioned<TYPE>& dt \
1633 internalFieldRef() op dt; \
1634 boundaryFieldRef() op dt.value(); \
1636 boundaryFieldRef().evaluate_if \
1638 [](const auto& pfld) { return pfld.constraintOverride(); } \
1647#undef COMPUTED_ASSIGNMENT
1652template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1664template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1671 tfld().writeData(
os);
1680template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1689 typename E::IntExpr,
1690 typename E::UncoupledPatchExpr,
1691 typename E::CoupledPatchExpr,
1692 typename E::value_type
1696 Internal(
io,
mesh, expr.dimensions(), false),
1698 boundaryField_(
mesh.
boundary(), *this, PatchField<Type>::calculatedType())
1701 <<
"Creating from expression " <<
nl << this->
info() << endl;
1711template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1717 const Expression::GeometricFieldExpression
1720 typename E::IntExpr,
1721 typename E::UncoupledPatchExpr,
1722 typename E::CoupledPatchExpr,
1723 typename E::value_type
1740 boundaryField_(
mesh.
boundary(), *this, PatchField<Type>::calculatedType())
1743 <<
"Creating from expression " <<
nl << this->
info() << endl;
1745 expr.evaluate(*
this);
1749template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1760template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1767 typename E::IntExpr,
1768 typename E::UncoupledPatchExpr,
1769 typename E::CoupledPatchExpr,
1770 typename E::value_type
1778template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
1785 typename E::IntExpr,
1786 typename E::UncoupledPatchExpr,
1787 typename E::CoupledPatchExpr,
1788 typename E::value_type
#define checkField(fld1, fld2, op)
#define COMPUTED_ASSIGNMENT(TYPE, op)
Y[inertIndex] clamp_min(0)
propsDict readIfPresent("fields", acceptFields)
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
DynamicField< Type > FieldType
Type of the field from which this DimensionedField is derived.
const Mesh & mesh() const noexcept
Return const reference to mesh.
const dimensionSet & dimensions() const noexcept
Return dimensions.
orientedType oriented() const noexcept
Return oriented type.
Dynamically sized Field. Similar to DynamicList, but inheriting from a Field instead of a List.
label capacity() const noexcept
Expression wrap of const reference to GeometricField.
Expression of GeometricField.
Expression wrap of non-const reference to GeometricField.
Container & evaluate(Container &lst) const
Helper: assign to passed in list.
Template invariant parts for Field and SubField.
static bool unifiedGeometricField
GeometricField with extra capacity for flattened boundary fields. Uses opt-switch "unifiedGeometricFi...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
SubField< scalar > slice(const label pos, label len=-1)
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
static int debug
Enable debug.
Generic GeometricField class.
Expression::GeometricFieldConstRefWrap< this_type > expr() const
Wrap value as expression.
void storeOldTime() const
Store the old-time field.
friend Ostream & operator(Ostream &, const GeometricField< Type, PatchField, GeoMesh > &)
Calls GeometricField::writeData().
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
DimensionedField< Type, GeoMesh > Internal
The internal field type from which this GeometricField is derived.
void clamp_range(const dimensioned< MinMax< Type > > &range)
Clamp field values (in-place) to the specified range.
label timeIndex() const noexcept
The time index of the field.
void relax()
Relax field (for steady-state solution).
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field).
GeoMesh::Mesh Mesh
The mesh type for the GeometricField.
void replace(const direction d, const GeometricField< cmptType, PatchField, GeoMesh > &gcf)
Replace specified field component with content from another field.
bool writeData(Ostream &os) const
The writeData function (required by regIOobject).
this_type & constCast() const noexcept
Return non-const reference to this field.
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct given IOobject, mesh, dimensions and patch type.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
void operator==(const tmp< GeometricField< Type, PatchField, GeoMesh > > &)
void clamp_min(const Type &lower)
Impose lower (floor) clamp on the field values (in-place).
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of boundary fields.
label nOldTimes() const noexcept
The number of old time fields stored.
const Internal::FieldType & primitiveField() const noexcept
void correctLocalBoundaryConditions()
Correct boundary conditions after a purely local operation.
Field< Type >::cmptType cmptType
Component type of the field elements.
Internal & internalFieldRef(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
const GeometricField< Type, PatchField, GeoMesh > & prevIter() const
Return previous iteration field.
bool needReference() const
Does the field need a reference level for solution.
label boundaryEvaluate(const Cop &cop)
Evaluate boundary functions using the field storage:
virtual ~GeometricField()
Destructor.
void negate()
Negate the field inplace. See notes in Field.
void clamp_max(const Type &upper)
Impose upper (ceiling) clamp on the field values (in-place).
void storePrevIter() const
Store the field as the previous iteration value.
word select(bool final) const
Select the final iteration parameters if final is true by returning the field name + "Final" otherwis...
void storeOldTimes() const
Store the old-time fields.
void correctBoundaryConditions()
Correct boundary field.
const Boundary & boundaryField() const noexcept
void normalise()
Normalise the field inplace. See notes in Field.
void operator=(const GeometricField< Type, PatchField, GeoMesh > &)
tmp< GeometricField< Type, PatchField, GeoMesh > > clone() const
Clone.
void writeMinMax(Ostream &os, label comm=UPstream::worldComm) const
Helper function to write the min and max to an Ostream.
void clearOldTimes()
Remove old-time and prev-iter fields.
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
bool isAnyRead() const noexcept
True if any reading may be required (ie, != NO_READ).
writeOption writeOpt() const noexcept
Get the write option.
bool registerObject() const noexcept
Should objects created with this IOobject be registered?
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
static bool isAnyRead(readOption opt) noexcept
True if any reading may be required (ie, != NO_READ).
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
const word & name() const noexcept
Return the object name.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
InfoProxy< IOobject > info() const noexcept
Return info proxy, for printing information to a stream.
A min/max value pair with additional methods. In addition to conveniently storing values,...
const T & min() const noexcept
The min value.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
A non-owning sub-view of a List (allocated or unallocated storage).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Generic dimensioned Type class.
const Type & value() const noexcept
Return const reference to value.
static void printStack(Ostream &os, int size=-1)
Helper function to print a stack, with optional upper limit.
void setUpToDate()
Set as up-to-date.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
rho clamp_range(rhoMin[i], rhoMax[i])
#define WarningInFunction
Report a warning using Foam::Warning.
#define DebugInFunction
Report an information message using Foam::Info.
#define InfoInFunction
Report an information message using Foam::Info.
Namespace for handling debugging switches.
List< word > wordList
List of word.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const dimensionSet dimless
Dimensionless.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
List< label > labelList
A List of labels.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
messageStream Info
Information stream (stdout output on master, null elsewhere).
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).
Us boundaryFieldRef().evaluateCoupled< coupledFaPatch >()
#define forAll(list, i)
Loop across all elements in list.
#define FOAM_UNLIKELY(cond)
conserve primitiveFieldRef()+