57 const label celli = cellIDs[i];
61 const scalar
f = factor[celli];
63 if (nbrs.
size() == 0 &&
f != 0.0)
66 <<
" at:" <<
mesh.cellCentres()[celli]
67 <<
" type:" <<
overlap.cellTypes()[celli]
68 <<
" stencil:" << nbrs
75 s += w[nbrI]*work[nbrs[nbrI]];
86 const cellCellStencil&
overlap = *
this;
93 overlap.cellInterpolationWeights()
98template<
class GeoField>
106 psi.correctBoundaryConditions();
110template<
class GeoField>
119 for (
const GeoField&
field :
mesh.thisDb().csorted<GeoField>())
127 Pout<<
"cellCellStencil::interpolate: interpolating : "
131 auto&
fld =
const_cast<GeoField&
>(
field);
135 fld.primitiveFieldRef(),
138 overlap.cellInterpolationWeights()
145 Pout<<
"cellCellStencil::interpolate: skipping : "
153Foam::tmp<Foam::volScalarField>
169 auto&
fld = tfld.ref();
179template<
class GeoField,
class SuppressBC>
187 psi.boundaryFieldRef().evaluate_if
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
bool found(const Key &key) const
Same as contains().
@ NO_REGISTER
Do not request registration (bool: false).
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
static int & msgType() noexcept
Message tag of standard messages.
Calculation of interpolation stencils.
static word baseName(const word &name)
Helper: strip off trailing _0.
static void correctBoundaryConditions(GeoField &psi)
Version of correctBoundaryConditions that excludes 'overset' bcs.
static void interpolate(Field< T > &psi, const fvMesh &mesh, const cellCellStencil &overlap, const List< scalarList > &wghts)
Interpolation of acceptor cells from donor cells.
static tmp< volScalarField > createField(const fvMesh &mesh, const word &name, const UList< Type > &)
Helper: create volScalarField for postprocessing.
Mesh data needed to do the Finite Volume discretisation.
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
Class containing processor-to-processor mapping information.
A traits class, which is primarily used for primitives and vector-space.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
const volScalarField & psi
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const cellCellStencilObject & overlap
Namespace for handling debugging switches.
const dimensionSet dimless
Dimensionless.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
static constexpr const zero Zero
Global zero (0).
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
List< scalar > scalarList
List of scalar.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
#define forAll(list, i)
Loop across all elements in list.