40 refValueFunc_(nullptr),
41 refGradFunc_(nullptr),
42 valueFractionFunc_(nullptr)
55 refValueFunc_(nullptr),
56 refGradFunc_(nullptr),
57 valueFractionFunc_(nullptr)
91 valueFractionFunc_(nullptr)
100 valueFractionFunc_.reset
102 Function1<scalar>::New
105 "uniformValueFraction",
112 else if (!refGradFunc_)
118 <<
"Require either or both: uniformValue and uniformGradient"
119 <<
" (possibly uniformValueFraction as well)" <<
nl
138 const uniformMixedFaPatchField<Type>& ptf,
140 const DimensionedField<Type, areaMesh>& iF,
141 const faPatchFieldMapper& mapper
144 mixedFaPatchField<Type>(ptf,
p, iF, mapper),
145 refValueFunc_(ptf.refValueFunc_.
clone()),
146 refGradFunc_(ptf.refGradFunc_.
clone()),
147 valueFractionFunc_(ptf.valueFractionFunc_.
clone())
158 refValueFunc_(ptf.refValueFunc_.
clone()),
159 refGradFunc_(ptf.refGradFunc_.
clone()),
160 valueFractionFunc_(ptf.valueFractionFunc_.
clone())
172 refValueFunc_(ptf.refValueFunc_.clone()),
173 refGradFunc_(ptf.refGradFunc_.clone()),
174 valueFractionFunc_(ptf.valueFractionFunc_.clone())
177 if (ptf.refValueFunc_ || ptf.refGradFunc_)
194 const scalar t = this->db().time().timeOutputValue();
198 this->refValue() = refValueFunc_->value(t);
203 this->valueFraction() = valueFractionFunc_->value(t);
208 this->valueFraction() = 1;
213 this->refValue() =
Zero;
214 this->valueFraction() = 0;
218 this->refGrad() = refGradFunc_->value(t);
222 this->refGrad() =
Zero;
239 refValueFunc_->writeData(
os);
243 refGradFunc_->writeData(
os);
245 if (valueFractionFunc_)
247 valueFractionFunc_->writeData(
os);
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))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
const word & name() const noexcept
Return the object name.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const objectRegistry & db() const
The associated objectRegistry.
virtual void readDict(const dictionary &dict)
Read dictionary entries.
bool updated() const noexcept
True if the boundary condition has already been updated.
const faPatch & patch() const noexcept
Return the patch.
A FieldMapper for finite-area patch fields.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void write(Ostream &os) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const DimensionedField< Type, areaMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
void extrapolateInternal()
Assign the patch field from the internal field.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
This boundary condition provides a base class for 'mixed' type boundary conditions,...
mixedFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual Field< Type > & refGrad()
virtual Field< Type > & refValue()
virtual scalarField & valueFraction()
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
const word & name() const noexcept
The patch name.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0).
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
A non-counting (dummy) refCount.