fvPatchField: Rationalised autoMap
This commit is contained in:
@ -210,59 +210,7 @@ void Foam::fvPatchField<Type>::autoMap
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
{
|
||||
Field<Type>& f = *this;
|
||||
|
||||
if (!this->size() && !mapper.distributed())
|
||||
{
|
||||
f.setSize(mapper.size());
|
||||
if (f.size())
|
||||
{
|
||||
f = this->patchInternalField();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Map all faces provided with mapping data
|
||||
mapper(*this, *this);
|
||||
|
||||
// For unmapped faces set to internal field value (zero-gradient)
|
||||
if (mapper.hasUnmapped())
|
||||
{
|
||||
Field<Type> pif(this->patchInternalField());
|
||||
|
||||
if
|
||||
(
|
||||
mapper.direct()
|
||||
&& notNull(mapper.directAddressing())
|
||||
&& mapper.directAddressing().size()
|
||||
)
|
||||
{
|
||||
const labelList& mapAddressing = mapper.directAddressing();
|
||||
|
||||
forAll(mapAddressing, i)
|
||||
{
|
||||
if (mapAddressing[i] < 0)
|
||||
{
|
||||
f[i] = pif[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!mapper.direct() && mapper.addressing().size())
|
||||
{
|
||||
const labelListList& mapAddressing = mapper.addressing();
|
||||
|
||||
forAll(mapAddressing, i)
|
||||
{
|
||||
const labelList& localAddrs = mapAddressing[i];
|
||||
|
||||
if (!localAddrs.size())
|
||||
{
|
||||
f[i] = pif[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user