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]); 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

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()); Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld; UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;
} }

View File

@ -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 "
@ -920,15 +932,13 @@ Foam::tmp<Foam::pointField> Foam::mappedPatchBase::samplePoints() const
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;
} }
@ -961,24 +971,22 @@ void Foam::mappedPatchBase::write(Ostream& os) const
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;
} }
} }
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -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_();
} }