Commit 13b1749d authored by andy's avatar andy
Browse files

STYLE: corrected/updated various comments/formatting

parent f3a9281c
......@@ -995,7 +995,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
scalar s = sum(wght[faceI]);
wghtSum[faceI] = s;
scalar t = s/patch[faceI].mag(patch.points());
scalar t = s/patch[faceI].mag(patch.localPoints());
if (t < minBound)
{
minBound = t;
......@@ -1309,9 +1309,11 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToSource
FatalErrorIn
(
"AMIInterpolation::interpolateToSource(const Field<Type>) const"
) << "Supplied field size is not equal to target patch size. "
<< "Target patch = " << tgtAddress_.size() << ", supplied field = "
<< fld.size() << abort(FatalError);
) << "Supplied field size is not equal to target patch size" << nl
<< " source patch = " << srcAddress_.size() << nl
<< " target patch = " << tgtAddress_.size() << nl
<< " supplied field = " << fld.size()
<< abort(FatalError);
}
tmp<Field<Type> > tresult
......@@ -1386,10 +1388,12 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget
{
FatalErrorIn
(
"AMIInterpolation::interpolateToSource(const Field<Type>&) const"
) << "Supplied field size is not equal to source patch size. "
<< "Source patch = " << srcAddress_.size() << ", supplied field = "
<< fld.size() << abort(FatalError);
"AMIInterpolation::interpolateToTarget(const Field<Type>&) const"
) << "Supplied field size is not equal to source patch size" << nl
<< " source patch = " << srcAddress_.size() << nl
<< " target patch = " << tgtAddress_.size() << nl
<< " supplied field = " << fld.size()
<< abort(FatalError);
}
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());
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;
}
......
......@@ -672,7 +672,10 @@ Foam::mappedPatchBase::mappedPatchBase
offsets_(pp.size(), offset_),
distance_(0),
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),
distance_(0),
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),
distance_(0),
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),
distance_(distance),
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"
"(\n"
" const polyPatch& pp,\n"
" const dictionary& dict\n"
" const polyPatch&,\n"
" const dictionary&\n"
")\n",
dict
) << "Please supply the offsetMode as one of "
......@@ -899,7 +911,7 @@ const Foam::polyPatch& Foam::mappedPatchBase::samplePolyPatch() const
if (patchI == -1)
{
FatalErrorIn("mappedPatchBase::samplePolyPatch() ")
FatalErrorIn("mappedPatchBase::samplePolyPatch()")
<< "Cannot find patch " << samplePatch_
<< " in region " << sampleRegion_ << endl
<< "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()));
pointField& fld = tfld();
switch(offsetMode_)
switch (offsetMode_)
{
case UNIFORM:
{
fld += offset_;
break;
}
break;
case NONUNIFORM:
{
fld += offsets_;
break;
}
break;
case NORMAL:
{
// Get outwards pointing normal
......@@ -936,8 +946,8 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::samplePoints() const
n /= mag(n);
fld += distance_*n;
break;
}
break;
}
return tfld;
......@@ -956,27 +966,25 @@ void Foam::mappedPatchBase::write(Ostream& os) const
os.writeKeyword("offsetMode") << offsetModeNames_[offsetMode_]
<< token::END_STATEMENT << nl;
switch(offsetMode_)
switch (offsetMode_)
{
case UNIFORM:
{
os.writeKeyword("offset") << offset_ << token::END_STATEMENT << nl;
break;
}
break;
case NONUNIFORM:
{
os.writeKeyword("offsets") << offsets_ << token::END_STATEMENT
<< nl;
break;
}
break;
case NORMAL:
{
os.writeKeyword("distance") << distance_ << token::END_STATEMENT
<< nl;
break;
}
break;
}
}
......
......@@ -33,9 +33,12 @@ Description
sampleRegion region0;
// What to sample:
// - nearestCell : sample nearest cell
// - nearestPatchFace : nearest face on selected patch
// - nearestFace : nearest boundary face on any patch
// - nearestCell : sample nearest cell
// - 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
sampleMode nearestCell;
// If sampleMod is nearestPatchFace : patch to find faces of
......@@ -82,7 +85,7 @@ class polyMesh;
class mapDistribute;
/*---------------------------------------------------------------------------*\
Class mappedPatchBase Declaration
Class mappedPatchBase Declaration
\*---------------------------------------------------------------------------*/
class mappedPatchBase
......@@ -317,6 +320,7 @@ public:
return offsets_;
}
//- Wrapper around map/interpolate data distribution
template<class Type>
void distribute(List<Type>& lst) const
{
......@@ -342,6 +346,7 @@ public:
{
calcMapping();
}
return mapPtr_();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment