mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: corrected/updated various comments/formatting
This commit is contained in:
@ -995,7 +995,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
|
|||||||
scalar s = sum(wght[faceI]);
|
scalar s = sum(wght[faceI]);
|
||||||
wghtSum[faceI] = s;
|
wghtSum[faceI] = s;
|
||||||
|
|
||||||
scalar t = s/patch[faceI].mag(patch.points());
|
scalar t = s/patch[faceI].mag(patch.localPoints());
|
||||||
if (t < minBound)
|
if (t < minBound)
|
||||||
{
|
{
|
||||||
minBound = t;
|
minBound = t;
|
||||||
@ -1309,9 +1309,11 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"AMIInterpolation::interpolateToSource(const Field<Type>) const"
|
"AMIInterpolation::interpolateToSource(const Field<Type>) const"
|
||||||
) << "Supplied field size is not equal to target patch size. "
|
) << "Supplied field size is not equal to target patch size" << nl
|
||||||
<< "Target patch = " << tgtAddress_.size() << ", supplied field = "
|
<< " source patch = " << srcAddress_.size() << nl
|
||||||
<< fld.size() << abort(FatalError);
|
<< " target patch = " << tgtAddress_.size() << nl
|
||||||
|
<< " supplied field = " << fld.size()
|
||||||
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp<Field<Type> > tresult
|
tmp<Field<Type> > tresult
|
||||||
@ -1386,10 +1388,12 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
|
|||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"AMIInterpolation::interpolateToSource(const Field<Type>&) const"
|
"AMIInterpolation::interpolateToTarget(const Field<Type>&) const"
|
||||||
) << "Supplied field size is not equal to source patch size. "
|
) << "Supplied field size is not equal to source patch size" << nl
|
||||||
<< "Source patch = " << srcAddress_.size() << ", supplied field = "
|
<< " source patch = " << srcAddress_.size() << nl
|
||||||
<< fld.size() << abort(FatalError);
|
<< " target patch = " << tgtAddress_.size() << nl
|
||||||
|
<< " supplied field = " << fld.size()
|
||||||
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp<Field<Type> > tresult
|
tmp<Field<Type> > tresult
|
||||||
|
|||||||
@ -148,7 +148,7 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign (this) patch internal field to its neighbour values
|
// Assign to (this) patch internal field its neighbour values
|
||||||
Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
|
Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
|
||||||
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;
|
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -672,7 +672,10 @@ Foam::mappedPatchBase::mappedPatchBase
|
|||||||
offsets_(pp.size(), offset_),
|
offsets_(pp.size(), offset_),
|
||||||
distance_(0),
|
distance_(0),
|
||||||
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
||||||
mapPtr_(NULL)
|
mapPtr_(NULL),
|
||||||
|
AMIPtr_(NULL),
|
||||||
|
surfPtr_(NULL),
|
||||||
|
surfDict_(dictionary::null)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -694,7 +697,10 @@ Foam::mappedPatchBase::mappedPatchBase
|
|||||||
offsets_(offsets),
|
offsets_(offsets),
|
||||||
distance_(0),
|
distance_(0),
|
||||||
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
||||||
mapPtr_(NULL)
|
mapPtr_(NULL),
|
||||||
|
AMIPtr_(NULL),
|
||||||
|
surfPtr_(NULL),
|
||||||
|
surfDict_(dictionary::null)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -716,7 +722,10 @@ Foam::mappedPatchBase::mappedPatchBase
|
|||||||
offsets_(0),
|
offsets_(0),
|
||||||
distance_(0),
|
distance_(0),
|
||||||
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
||||||
mapPtr_(NULL)
|
mapPtr_(NULL),
|
||||||
|
AMIPtr_(NULL),
|
||||||
|
surfPtr_(NULL),
|
||||||
|
surfDict_(dictionary::null)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -738,7 +747,10 @@ Foam::mappedPatchBase::mappedPatchBase
|
|||||||
offsets_(0),
|
offsets_(0),
|
||||||
distance_(distance),
|
distance_(distance),
|
||||||
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
|
||||||
mapPtr_(NULL)
|
mapPtr_(NULL),
|
||||||
|
AMIPtr_(NULL),
|
||||||
|
surfPtr_(NULL),
|
||||||
|
surfDict_(dictionary::null)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -810,8 +822,8 @@ Foam::mappedPatchBase::mappedPatchBase
|
|||||||
(
|
(
|
||||||
"mappedPatchBase::mappedPatchBase\n"
|
"mappedPatchBase::mappedPatchBase\n"
|
||||||
"(\n"
|
"(\n"
|
||||||
" const polyPatch& pp,\n"
|
" const polyPatch&,\n"
|
||||||
" const dictionary& dict\n"
|
" const dictionary&\n"
|
||||||
")\n",
|
")\n",
|
||||||
dict
|
dict
|
||||||
) << "Please supply the offsetMode as one of "
|
) << "Please supply the offsetMode as one of "
|
||||||
@ -899,7 +911,7 @@ const Foam::polyPatch& Foam::mappedPatchBase::samplePolyPatch() const
|
|||||||
|
|
||||||
if (patchI == -1)
|
if (patchI == -1)
|
||||||
{
|
{
|
||||||
FatalErrorIn("mappedPatchBase::samplePolyPatch() ")
|
FatalErrorIn("mappedPatchBase::samplePolyPatch()")
|
||||||
<< "Cannot find patch " << samplePatch_
|
<< "Cannot find patch " << samplePatch_
|
||||||
<< " in region " << sampleRegion_ << endl
|
<< " in region " << sampleRegion_ << endl
|
||||||
<< "Valid patches are " << nbrMesh.boundaryMesh().names()
|
<< "Valid patches are " << nbrMesh.boundaryMesh().names()
|
||||||
@ -915,20 +927,18 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::samplePoints() const
|
|||||||
tmp<pointField> tfld(new pointField(patch_.faceCentres()));
|
tmp<pointField> tfld(new pointField(patch_.faceCentres()));
|
||||||
pointField& fld = tfld();
|
pointField& fld = tfld();
|
||||||
|
|
||||||
switch(offsetMode_)
|
switch (offsetMode_)
|
||||||
{
|
{
|
||||||
case UNIFORM:
|
case UNIFORM:
|
||||||
{
|
{
|
||||||
fld += offset_;
|
fld += offset_;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case NONUNIFORM:
|
case NONUNIFORM:
|
||||||
{
|
{
|
||||||
fld += offsets_;
|
fld += offsets_;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
{
|
{
|
||||||
// Get outwards pointing normal
|
// Get outwards pointing normal
|
||||||
@ -936,9 +946,9 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::samplePoints() const
|
|||||||
n /= mag(n);
|
n /= mag(n);
|
||||||
|
|
||||||
fld += distance_*n;
|
fld += distance_*n;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return tfld;
|
return tfld;
|
||||||
}
|
}
|
||||||
@ -956,28 +966,26 @@ void Foam::mappedPatchBase::write(Ostream& os) const
|
|||||||
os.writeKeyword("offsetMode") << offsetModeNames_[offsetMode_]
|
os.writeKeyword("offsetMode") << offsetModeNames_[offsetMode_]
|
||||||
<< token::END_STATEMENT << nl;
|
<< token::END_STATEMENT << nl;
|
||||||
|
|
||||||
switch(offsetMode_)
|
switch (offsetMode_)
|
||||||
{
|
{
|
||||||
case UNIFORM:
|
case UNIFORM:
|
||||||
{
|
{
|
||||||
os.writeKeyword("offset") << offset_ << token::END_STATEMENT << nl;
|
os.writeKeyword("offset") << offset_ << token::END_STATEMENT << nl;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case NONUNIFORM:
|
case NONUNIFORM:
|
||||||
{
|
{
|
||||||
os.writeKeyword("offsets") << offsets_ << token::END_STATEMENT
|
os.writeKeyword("offsets") << offsets_ << token::END_STATEMENT
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
{
|
{
|
||||||
os.writeKeyword("distance") << distance_ << token::END_STATEMENT
|
os.writeKeyword("distance") << distance_ << token::END_STATEMENT
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,9 @@ Description
|
|||||||
// What to sample:
|
// What to sample:
|
||||||
// - nearestCell : sample nearest cell
|
// - nearestCell : sample nearest cell
|
||||||
// - nearestPatchFace : nearest face on selected patch
|
// - nearestPatchFace : nearest face on selected patch
|
||||||
|
// - nearestPatchFaceAMI : nearest face on selected patch
|
||||||
|
- patches need not conform
|
||||||
|
- uses AMI interpolation
|
||||||
// - nearestFace : nearest boundary face on any patch
|
// - nearestFace : nearest boundary face on any patch
|
||||||
sampleMode nearestCell;
|
sampleMode nearestCell;
|
||||||
|
|
||||||
@ -317,6 +320,7 @@ public:
|
|||||||
return offsets_;
|
return offsets_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Wrapper around map/interpolate data distribution
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void distribute(List<Type>& lst) const
|
void distribute(List<Type>& lst) const
|
||||||
{
|
{
|
||||||
@ -342,6 +346,7 @@ public:
|
|||||||
{
|
{
|
||||||
calcMapping();
|
calcMapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
return mapPtr_();
|
return mapPtr_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user