STYLE: corrected/updated various comments/formatting

This commit is contained in:
andy
2011-09-05 17:34:39 +01:00
parent f3a9281c47
commit 13b1749d5e
4 changed files with 49 additions and 32 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}
case NONUNIFORM:
{
fld += offsets_;
}
break;
}
case NORMAL:
{
// Get outwards pointing normal
@ -936,9 +946,9 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::samplePoints() const
n /= mag(n);
fld += distance_*n;
}
break;
}
}
return tfld;
}
@ -956,28 +966,26 @@ 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;
}
case NONUNIFORM:
{
os.writeKeyword("offsets") << offsets_ << token::END_STATEMENT
<< nl;
}
break;
}
case NORMAL:
{
os.writeKeyword("distance") << distance_ << token::END_STATEMENT
<< nl;
}
break;
}
}
}

View File

@ -35,6 +35,9 @@ Description
// What to sample:
// - 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;
@ -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_();
}