本文整理汇总了C++中pointPatch::size方法的典型用法代码示例。如果您正苦于以下问题:C++ pointPatch::size方法的具体用法?C++ pointPatch::size怎么用?C++ pointPatch::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pointPatch
的用法示例。
在下文中一共展示了pointPatch::size方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Foam::valuePointPatchField<Type>::valuePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict,
const bool valueRequired
)
:
pointPatchField<Type>(p, iF, dict),
Field<Type>(p.size())
{
if (dict.found("value"))
{
Field<Type>::operator=
(
Field<Type>("value", dict, p.size())
);
}
else if (!valueRequired)
{
Field<Type>::operator=(Zero);
}
else
{
FatalIOErrorInFunction
(
dict
) << "Essential entry 'value' missing"
<< exit(FatalIOError);
}
}
示例2: mixedPointPatchFieldType
groovyBCPointPatchField<Type>::groovyBCPointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
mixedPointPatchFieldType(p, iF),
groovyBCCommon<Type>(dict,false,true),
driver_(dict,getFvPatch(this->patch()))
{
driver_.readVariablesAndTables(dict);
if (dict.found("refValue")) {
this->refValue() = Field<Type>("refValue", dict, p.size());
} else {
this->refValue() = pTraits<Type>::zero;
}
if (dict.found("value"))
{
Field<Type>::operator=
(
Field<Type>("value", dict, p.size())
);
}
else
{
Field<Type>::operator=(this->refValue());
WarningIn(
"groovyBCPointPatchField<Type>::groovyBCPointPatchField"
"("
"const pointPatch& p,"
"const DimensionedField<Type, pointMesh>& iF,"
"const dictionary& dict"
")"
) << "No value defined for " << this->dimensionedInternalField().name()
<< " on " << this->patch().name() << " therefore using "
<< this->refValue()
<< endl;
}
// this->refGrad() = pTraits<Type>::zero;
if (dict.found("valueFraction")) {
this->valueFraction() = Field<scalar>("valueFraction", dict, p.size());
} else {
this->valueFraction() = 1;
}
if(this->evaluateDuringConstruction()) {
// make sure that this works with potentialFoam or other solvers that don't evaluate the BCs
this->evaluate();
} else {
// mixed-BC DOES NOT call evaluate during construction
}
}
示例3: fixedValuePointPatchVectorField
oscillatingVelocityPointPatchVectorField::
oscillatingVelocityPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchVectorField(p, iF, dict),
amplitude_(dict.lookup("amplitude")),
omega_(readScalar(dict.lookup("omega")))
{
if (!dict.found("value"))
{
updateCoeffs();
}
if (dict.found("p0"))
{
p0_ = vectorField("p0", dict , p.size());
}
else
{
p0_ = p.localPoints();
}
}
示例4: fixedValuePointPatchVectorField
angularOscillatingDisplacementPointPatchVectorField::
angularOscillatingDisplacementPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchVectorField(p, iF, dict),
axis_(dict.lookup("axis")),
origin_(dict.lookup("origin")),
angle0_(readScalar(dict.lookup("angle0"))),
amplitude_(readScalar(dict.lookup("amplitude"))),
omega_(readScalar(dict.lookup("omega")))
{
if (!dict.found("value"))
{
updateCoeffs();
}
if (dict.found("p0"))
{
p0_ = vectorField("p0", dict , p.size());
}
else
{
p0_ = p.localPoints();
}
}
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:29,代码来源:angularOscillatingDisplacementPointPatchVectorField.C
示例5:
Foam::valuePointPatchField<Type>::valuePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF
)
:
pointPatchField<Type>(p, iF),
Field<Type>(p.size())
{}
示例6:
Foam::
timeVaryingMappedFixedValuePointPatchField<Type>::
timeVaryingMappedFixedValuePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<Type>(p, iF),
fieldTableName_(iF.name()),
setAverage_(readBool(dict.lookup("setAverage"))),
perturb_(dict.lookupOrDefault("perturb", 1e-5)),
mapMethod_
(
dict.lookupOrDefault<word>
(
"mapMethod",
"planarInterpolation"
)
),
mapperPtr_(NULL),
sampleTimes_(0),
startSampleTime_(-1),
startSampledValues_(0),
startAverage_(pTraits<Type>::zero),
endSampleTime_(-1),
endSampledValues_(0),
endAverage_(pTraits<Type>::zero),
offset_()
{
if (dict.found("offset"))
{
offset_ = DataEntry<Type>::New("offset", dict);
}
dict.readIfPresent("fieldTableName", fieldTableName_);
if (dict.found("value"))
{
fixedValuePointPatchField<Type>::operator==
(
Field<Type>("value", dict, p.size())
);
}
else
{
// Note: use evaluate to do updateCoeffs followed by a reset
// of the pointPatchField::updated_ flag. This is
// so if first use is in the next time step it retriggers
// a new update.
pointPatchField<Type>::evaluate(Pstream::blocking);
}
}
示例7: pointMap
Foam::pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
(
const pointPatch& completeMeshPatch,
const pointPatch& procMeshPatch,
const labelList& directAddr
)
:
pointPatchFieldMapperPatchRef
(
completeMeshPatch,
procMeshPatch
),
directAddressing_(procMeshPatch.size(), -1)
{
// Create the inverse-addressing of the patch point labels.
labelList pointMap(completeMeshPatch.boundaryMesh().mesh().size(), -1);
const labelList& completeMeshPatchPoints = completeMeshPatch.meshPoints();
forAll(completeMeshPatchPoints, pointi)
{
pointMap[completeMeshPatchPoints[pointi]] = pointi;
}
// Use the inverse point addressing to create the addressing table for this
// patch
const labelList& procMeshPatchPoints = procMeshPatch.meshPoints();
forAll(procMeshPatchPoints, pointi)
{
directAddressing_[pointi] =
pointMap[directAddr[procMeshPatchPoints[pointi]]];
}
// Check that all the patch point addresses are set
if (directAddressing_.size() && min(directAddressing_) < 0)
{
FatalErrorIn
(
"pointFieldDecomposer::patchFieldDecomposer()"
) << "Incomplete patch point addressing"
<< abort(FatalError);
}
}
示例8: readScalar
sixDoFRigidBodyDisplacementPointPatchVectorField::
sixDoFRigidBodyDisplacementPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<vector>(p, iF, dict),
motion_(dict),
rhoInf_(1.0),
rhoName_(dict.lookupOrDefault<word>("rhoName", "rho")),
lookupGravity_(-1),
g_(vector::zero),
relaxationFactor_(dict.lookupOrDefault<scalar>("relaxationFactor", 1))
{
if (rhoName_ == "rhoInf")
{
rhoInf_ = readScalar(dict.lookup("rhoInf"));
}
if (dict.readIfPresent("g", g_))
{
lookupGravity_ = -2;
}
if (!dict.found("value"))
{
updateCoeffs();
}
if (dict.found("initialPoints"))
{
initialPoints_ = vectorField("initialPoints", dict , p.size());
}
else
{
initialPoints_ = p.localPoints();
}
}
示例9:
uniformFixedValuePointPatchField<Type>::
uniformFixedValuePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<Type>(p, iF, dict, false),
uniformValue_(DataEntry<Type>::New("uniformValue", dict))
{
if (dict.found("value"))
{
fixedValuePointPatchField<Type>::operator==
(
Field<Type>("value", dict, p.size())
);
}
else
{
const scalar t = this->db().time().timeOutputValue();
fixedValuePointPatchField<Type>::operator=(uniformValue_->value(t));
}
}
示例10: vectorField
Foam::
dissolMotionPointPatchVectorField::
dissolMotionPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<vector>(p, iF)
{
if(debug) {
Info << "dissolMotionPointPatchVectorField constructor 2"<<endl;
}
if (dict.found("value"))
{
this->operator==
(
vectorField("value", dict, p.size())
);
}
else
{
WarningIn(
"dissolMotionPointPatchVectorField constructor 2"
"("
"const pointPatch& p,"
"const DimensionedField<vector, pointMesh>& iF,"
"const dictionary& dict"
")"
) << "No value defined for " << this->internalField().name()
<< " on " << this->patch().name()
<< endl;
}
if (!dict.readIfPresent<scalar>("rlxTol", rlxTol))
{
rlxTol = 1.0e-6;
WarningIn
(
"dissolMotionPointPatchVectorField constructor 2"
"("
"const fvPatch& p,"
"const DimensionedField<Type, volMesh>& iF,"
"const dictionary& dict"
")"
)
<< "No value defined for rlxTol"
<< " on " << this->patch().name() << " therefore using "
<< rlxTol
<< endl;
}
if (!dict.readIfPresent<int>("q_norm_recalc", q_norm_recalc))
{
q_norm_recalc = 1;
WarningIn
(
"dissolMotionPointPatchVectorField constructor 2"
"("
"const fvPatch& p,"
"const DimensionedField<Type, volMesh>& iF,"
"const dictionary& dict"
")"
)
<< "No value defined for q_norm_recalc"
<< " on " << this->patch().name() << " therefore using "
<< q_norm_recalc
<< endl;
}
if (!dict.readIfPresent<scalar>("k_1", k_1))
{
k_1 = 1.0;
WarningIn
(
"dissolMotionPointPatchVectorField constructor 2"
"("
"const fvPatch& p,"
"const DimensionedField<Type, volMesh>& iF,"
"const dictionary& dict"
")"
)
<< "No value defined for k_1"
<< " on " << this->patch().name() << " therefore using "
<< k_1
<< endl;
}
if (!dict.readIfPresent<scalar>("k_2", k_2))
{
k_2 = 1.0;
WarningIn
(
"dissolMotionPointPatchVectorField constructor 2"
"("
"const fvPatch& p,"
"const DimensionedField<Type, volMesh>& iF,"
"const dictionary& dict"
")"
)
//.........这里部分代码省略.........