50 if (sparseInputLocations.
empty())
55 compactFld[i] =
fld[i];
60 if (
fld.size() != sparseInputLocations.
size())
63 <<
"Input field size (" <<
fld.size()
64 <<
" != sparse ids size ("
65 << sparseInputLocations.
size() <<
")\n"
70 forAll(sparseInputLocations, i)
72 const label idx = sparseInputLocations[i];
75 compactFld[idx] =
fld[i];
82 mapDistributeBase::distribute<Type>(compactFld);
96 this->distributeSparse(
fld, sparseInputLocations, boundaryToCompact_);
103 this->distributeSparse(
fld, inputMeshFaces_, boundaryToCompact_);
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A List with indirect addressing. Like IndirectList but does not store addressing.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if this a parallel run.
void distributeSparse(List< Type > &fld, const labelUList &sparseInputLocations, const labelUList &compactOutputMapping) const
Distribute sparse data.
label constructSize() const noexcept
Constructed data size.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.