Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
commit
0efe54b50b
@ -1,22 +1,23 @@
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
forAll(U.boundaryField(), patchi)
|
||||
forAll(U.boundaryField(), patchI)
|
||||
{
|
||||
if (U.boundaryField()[patchi].fixesValue())
|
||||
if (U.boundaryField()[patchI].fixesValue())
|
||||
{
|
||||
U.boundaryField()[patchi].initEvaluate();
|
||||
U.boundaryField()[patchI].initEvaluate();
|
||||
}
|
||||
}
|
||||
|
||||
forAll(U.boundaryField(), patchi)
|
||||
forAll(U.boundaryField(), patchI)
|
||||
{
|
||||
if (U.boundaryField()[patchi].fixesValue())
|
||||
if (U.boundaryField()[patchI].fixesValue())
|
||||
{
|
||||
U.boundaryField()[patchi].evaluate();
|
||||
U.boundaryField()[patchI].evaluate();
|
||||
|
||||
phi.boundaryField()[patchi] =
|
||||
U.boundaryField()[patchi] & mesh.Sf().boundaryField()[patchi];
|
||||
phi.boundaryField()[patchI] =
|
||||
U.boundaryField()[patchI]
|
||||
& mesh.Sf().boundaryField()[patchI];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -27,11 +28,11 @@
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(p.boundaryField(), i)
|
||||
forAll(p.boundaryField(), patchI)
|
||||
{
|
||||
if (p.boundaryField()[i].fixesValue())
|
||||
if (p.boundaryField()[patchI].fixesValue())
|
||||
{
|
||||
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
pcorrTypes[patchI] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ void Foam::ParticleErosion<CloudType>::preEvolve()
|
||||
this->owner().name() + "Q",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
|
@ -290,184 +290,71 @@ public:
|
||||
|
||||
void clearOut();
|
||||
|
||||
//- What to sample
|
||||
const sampleMode& mode() const
|
||||
{
|
||||
return mode_;
|
||||
}
|
||||
// Access
|
||||
|
||||
//- Region to sample
|
||||
const word& sampleRegion() const
|
||||
{
|
||||
return sampleRegion_;
|
||||
}
|
||||
//- What to sample
|
||||
inline const sampleMode& mode() const;
|
||||
|
||||
//- Patch (only if NEARESTPATCHFACE)
|
||||
const word& samplePatch() const
|
||||
{
|
||||
return samplePatch_;
|
||||
}
|
||||
//- Region to sample
|
||||
inline const word& sampleRegion() const;
|
||||
|
||||
//- Offset vector (from patch faces to destination mesh objects)
|
||||
const vector& offset() const
|
||||
{
|
||||
return offset_;
|
||||
}
|
||||
//- Patch (only if NEARESTPATCHFACE)
|
||||
inline const word& samplePatch() const;
|
||||
|
||||
//- Offset vector (from patch faces to destination mesh objects)
|
||||
const vectorField& offsets() const
|
||||
{
|
||||
return offsets_;
|
||||
}
|
||||
//- Offset vector (from patch faces to destination mesh objects)
|
||||
inline const vector& offset() const;
|
||||
|
||||
//- Wrapper around map/interpolate data distribution
|
||||
template<class Type>
|
||||
void distribute(List<Type>& lst) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToSource(Field<Type>(lst.xfer()));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
map().distribute(lst);
|
||||
}
|
||||
}
|
||||
}
|
||||
//- Offset vector (from patch faces to destination mesh objects)
|
||||
inline const vectorField& offsets() const;
|
||||
|
||||
//- Cached sampleRegion != mesh.name()
|
||||
inline bool sameRegion() const;
|
||||
|
||||
//- Return reference to the parallel distribution map
|
||||
inline const mapDistribute& map() const;
|
||||
|
||||
//- Return reference to the AMI interpolator
|
||||
inline const AMIPatchToPatchInterpolation& AMI
|
||||
(
|
||||
const bool forceUpdate = false
|
||||
) const;
|
||||
|
||||
//- Return a pointer to the AMI projection surface
|
||||
const autoPtr<Foam::searchableSurface>& surfPtr() const;
|
||||
|
||||
//- Get the region mesh
|
||||
const polyMesh& sampleMesh() const;
|
||||
|
||||
//- Get the patch on the region
|
||||
const polyPatch& samplePolyPatch() const;
|
||||
|
||||
//- Get the sample points
|
||||
tmp<pointField> samplePoints() const;
|
||||
|
||||
|
||||
//- Wrapper around map/interpolate data distribution with supplied op
|
||||
template<class Type, class BinaryOp>
|
||||
void distribute(List<Type>& lst, const BinaryOp& bop) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToSource
|
||||
(
|
||||
Field<Type>(lst.xfer()),
|
||||
bop
|
||||
);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
map().distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
map().schedule(),
|
||||
map().constructSize(),
|
||||
map().subMap(),
|
||||
map().constructMap(),
|
||||
lst,
|
||||
bop,
|
||||
pTraits<Type>::zero
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Distribute
|
||||
|
||||
//- Wrapper around map/interpolate data distribution
|
||||
template<class Type>
|
||||
void distribute(List<Type>& lst) const;
|
||||
|
||||
//- Wrapper around map/interpolate data distribution with operation
|
||||
template<class Type, class BinaryOp>
|
||||
void distribute(List<Type>& lst, const BinaryOp& bop) const;
|
||||
|
||||
//- Wrapper around map/interpolate data distribution
|
||||
template<class Type>
|
||||
void reverseDistribute(List<Type>& lst) const;
|
||||
|
||||
//- Wrapper around map/interpolate data distribution with operation
|
||||
template<class Type, class BinaryOp>
|
||||
void reverseDistribute(List<Type>& lst, const BinaryOp& bop) const;
|
||||
|
||||
|
||||
//- Wrapper around map/interpolate data distribution
|
||||
template<class Type>
|
||||
void reverseDistribute(List<Type>& lst) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToTarget(Field<Type>(lst.xfer()));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
label cSize = patch_.size();
|
||||
map().reverseDistribute(cSize, lst);
|
||||
}
|
||||
}
|
||||
}
|
||||
// I/O
|
||||
|
||||
|
||||
//- Wrapper around map/interpolate data distribution with supplied op
|
||||
template<class Type, class BinaryOp>
|
||||
void reverseDistribute(List<Type>& lst, const BinaryOp& bop) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToTarget
|
||||
(
|
||||
Field<Type>(lst.xfer()),
|
||||
bop
|
||||
);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
label cSize = patch_.size();
|
||||
map().distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
map().schedule(),
|
||||
cSize,
|
||||
map().constructMap(),
|
||||
map().subMap(),
|
||||
lst,
|
||||
bop,
|
||||
pTraits<Type>::zero
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//- Return reference to the parallel distribution map
|
||||
const mapDistribute& map() const
|
||||
{
|
||||
if (mapPtr_.empty())
|
||||
{
|
||||
calcMapping();
|
||||
}
|
||||
|
||||
return mapPtr_();
|
||||
}
|
||||
|
||||
//- Return reference to the AMI interpolator
|
||||
const AMIPatchToPatchInterpolation& AMI(bool forceUpdate = false) const
|
||||
{
|
||||
if (forceUpdate || AMIPtr_.empty())
|
||||
{
|
||||
calcAMI();
|
||||
}
|
||||
|
||||
return AMIPtr_();
|
||||
}
|
||||
|
||||
//- Return a pointer to the AMI projection surface
|
||||
const autoPtr<Foam::searchableSurface>& surfPtr() const;
|
||||
|
||||
//- Cached sampleRegion != mesh.name()
|
||||
bool sameRegion() const
|
||||
{
|
||||
return sameRegion_;
|
||||
}
|
||||
|
||||
//- Get the region mesh
|
||||
const polyMesh& sampleMesh() const;
|
||||
|
||||
//- Get the patch on the region
|
||||
const polyPatch& samplePolyPatch() const;
|
||||
|
||||
//- Get the sample points
|
||||
tmp<pointField> samplePoints() const;
|
||||
|
||||
//- Write as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
//- Write as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
@ -477,6 +364,16 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "mappedPatchBaseI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "mappedPatchBaseTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -0,0 +1,88 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
inline const Foam::mappedPatchBase::sampleMode&
|
||||
Foam::mappedPatchBase::mode() const
|
||||
{
|
||||
return mode_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word& Foam::mappedPatchBase::sampleRegion() const
|
||||
{
|
||||
return sampleRegion_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word& Foam::mappedPatchBase::samplePatch() const
|
||||
{
|
||||
return samplePatch_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vector& Foam::mappedPatchBase::offset() const
|
||||
{
|
||||
return offset_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::vectorField& Foam::mappedPatchBase::offsets() const
|
||||
{
|
||||
return offsets_;
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::mappedPatchBase::sameRegion() const
|
||||
{
|
||||
return sameRegion_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::mapDistribute& Foam::mappedPatchBase::map() const
|
||||
{
|
||||
if (mapPtr_.empty())
|
||||
{
|
||||
calcMapping();
|
||||
}
|
||||
|
||||
return mapPtr_();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::AMIPatchToPatchInterpolation& Foam::mappedPatchBase::AMI
|
||||
(
|
||||
bool forceUpdate
|
||||
) const
|
||||
{
|
||||
if (forceUpdate || AMIPtr_.empty())
|
||||
{
|
||||
calcAMI();
|
||||
}
|
||||
|
||||
return AMIPtr_();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,136 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
void Foam::mappedPatchBase::distribute(List<Type>& lst) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToSource(Field<Type>(lst.xfer()));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
map().distribute(lst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class BinaryOp>
|
||||
void Foam::mappedPatchBase::distribute
|
||||
(
|
||||
List<Type>& lst,
|
||||
const BinaryOp& bop
|
||||
) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToSource
|
||||
(
|
||||
Field<Type>(lst.xfer()),
|
||||
bop
|
||||
);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
map().distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
map().schedule(),
|
||||
map().constructSize(),
|
||||
map().subMap(),
|
||||
map().constructMap(),
|
||||
lst,
|
||||
bop,
|
||||
pTraits<Type>::zero
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::mappedPatchBase::reverseDistribute(List<Type>& lst) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToTarget(Field<Type>(lst.xfer()));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
label cSize = patch_.size();
|
||||
map().reverseDistribute(cSize, lst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class BinaryOp>
|
||||
void Foam::mappedPatchBase::reverseDistribute
|
||||
(
|
||||
List<Type>& lst,
|
||||
const BinaryOp& bop
|
||||
) const
|
||||
{
|
||||
switch (mode_)
|
||||
{
|
||||
case NEARESTPATCHFACEAMI:
|
||||
{
|
||||
lst = AMI().interpolateToTarget
|
||||
(
|
||||
Field<Type>(lst.xfer()),
|
||||
bop
|
||||
);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
label cSize = patch_.size();
|
||||
map().distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
map().schedule(),
|
||||
cSize,
|
||||
map().constructMap(),
|
||||
map().subMap(),
|
||||
lst,
|
||||
bop,
|
||||
pTraits<Type>::zero
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
Loading…
Reference in New Issue
Block a user