40 refValueFunc_(nullptr),
41 refGradFunc_(nullptr),
42 valueFractionFunc_(nullptr)
55 refValueFunc_(nullptr),
56 refGradFunc_(nullptr),
57 valueFractionFunc_(nullptr)
79 valueFractionFunc_(nullptr)
88 valueFractionFunc_.reset
90 PatchFunction1<scalar>::New
93 "uniformValueFraction",
99 else if (!refGradFunc_)
105 <<
"Require either or both: uniformValue and uniformGradient"
106 <<
" (possibly uniformValueFraction as well)" <<
nl
125 const uniformMixedFvPatchField<Type>& ptf,
127 const DimensionedField<Type, volMesh>& iF,
128 const fvPatchFieldMapper& mapper
131 mixedFvPatchField<Type>(ptf,
p, iF, mapper),
134 valueFractionFunc_(ptf.valueFractionFunc_.
clone(
p.
patch()))
147 valueFractionFunc_(ptf.valueFractionFunc_.
clone(this->
patch().
patch()))
159 refValueFunc_(ptf.refValueFunc_.clone(this->patch().patch())),
160 refGradFunc_(ptf.refGradFunc_.clone(this->patch().patch())),
161 valueFractionFunc_(ptf.valueFractionFunc_.clone(this->patch().patch()))
164 if (ptf.refValueFunc_ || ptf.refGradFunc_)
181 const scalar t = this->db().time().timeOutputValue();
185 this->refValue() = refValueFunc_->value(t);
190 this->valueFraction() = valueFractionFunc_->value(t);
195 this->valueFraction() = 1;
200 this->refValue() =
Zero;
201 this->valueFraction() = 0;
205 this->refGrad() = refGradFunc_->value(t);
209 this->refGrad() =
Zero;
226 refValueFunc_->writeData(
os);
230 refGradFunc_->writeData(
os);
232 if (valueFractionFunc_)
234 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...
const word & name() const noexcept
Return the object name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
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.
const fvPatch & patch() const noexcept
Return the patch.
bool updated() const noexcept
True if the boundary condition has already been updated.
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch 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.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return name.
This boundary condition provides a base class for 'mixed' type boundary conditions,...
mixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
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.
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.