mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
dropped polyMesh::resetPrimitives copy version
This commit is contained in:
@ -939,124 +939,6 @@ Foam::polyMesh::polyMesh
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyMesh::resetPrimitives
|
||||
(
|
||||
const label nUsedFaces,
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
const labelList& owner,
|
||||
const labelList& neighbour,
|
||||
const labelList& patchSizes,
|
||||
const labelList& patchStarts,
|
||||
const bool validBoundary
|
||||
)
|
||||
{
|
||||
// Clear addressing. Keep geometric props for mapping.
|
||||
clearAddressing();
|
||||
|
||||
// Take over new primitive data.
|
||||
// Optimized to prevent self-assignment to self and
|
||||
// to avoid overwriting data at all
|
||||
if (&points && &points_ != &points)
|
||||
{
|
||||
points_ = points;
|
||||
bounds_ = boundBox(points_, validBoundary);
|
||||
}
|
||||
if (&faces && &faces_ != &faces)
|
||||
{
|
||||
faces_ = faces;
|
||||
}
|
||||
if (&owner && &owner_ != &owner)
|
||||
{
|
||||
owner_ = owner;
|
||||
}
|
||||
if (&neighbour && &neighbour_ != &neighbour)
|
||||
{
|
||||
neighbour_ = neighbour;
|
||||
}
|
||||
|
||||
// Reset patch sizes and starts
|
||||
forAll(boundary_, patchI)
|
||||
{
|
||||
boundary_[patchI] = polyPatch
|
||||
(
|
||||
boundary_[patchI].name(),
|
||||
patchSizes[patchI],
|
||||
patchStarts[patchI],
|
||||
patchI,
|
||||
boundary_
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Flags the mesh files as being changed
|
||||
setInstance(time().timeName());
|
||||
|
||||
// Check if the faces and cells are valid
|
||||
forAll (faces_, faceI)
|
||||
{
|
||||
const face& curFace = faces_[faceI];
|
||||
|
||||
if (min(curFace) < 0 || max(curFace) > points_.size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"polyMesh::polyMesh::resetPrimitives\n"
|
||||
"(\n"
|
||||
" const label nUsedFaces,\n"
|
||||
" const pointField& points,\n"
|
||||
" const faceList& faces,\n"
|
||||
" const labelList& owner,\n"
|
||||
" const labelList& neighbour,\n"
|
||||
" const labelList& patchSizes,\n"
|
||||
" const labelList& patchStarts\n"
|
||||
")\n"
|
||||
) << "Face " << faceI << " contains vertex labels out of range: "
|
||||
<< curFace << " Max point index = " << points_.size()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set the primitive mesh from the owner_, neighbour_. Works
|
||||
// out from patch end where the active faces stop.
|
||||
initMesh();
|
||||
|
||||
|
||||
if (validBoundary)
|
||||
{
|
||||
// Note that we assume that all the patches stay the same and are
|
||||
// correct etc. so we can already use the patches to do
|
||||
// processor-processor comms.
|
||||
|
||||
// Calculate topology for the patches (processor-processor comms etc.)
|
||||
boundary_.updateMesh();
|
||||
|
||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||
boundary_.calcGeometry();
|
||||
|
||||
// Warn if global empty mesh (constructs globalData!)
|
||||
if (globalData().nTotalPoints() == 0 || globalData().nTotalCells() == 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"polyMesh::polyMesh::resetPrimitives\n"
|
||||
"(\n"
|
||||
" const label nUsedFaces,\n"
|
||||
" const pointField& points,\n"
|
||||
" const faceList& faces,\n"
|
||||
" const labelList& owner,\n"
|
||||
" const labelList& neighbour,\n"
|
||||
" const labelList& patchSizes,\n"
|
||||
" const labelList& patchStarts\n"
|
||||
")\n"
|
||||
)
|
||||
<< "no points or no cells in mesh" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyMesh::resetPrimitives
|
||||
(
|
||||
const xfer<pointField>& points,
|
||||
|
||||
@ -453,23 +453,6 @@ public:
|
||||
//- Remove boundary patches
|
||||
void removeBoundary();
|
||||
|
||||
//- Reset mesh primitive data. Assumes all patch info correct
|
||||
// (so does e.g. parallel communication). If not use
|
||||
// validBoundary=false
|
||||
// (still assumes patchStarts[0] = nInternalFaces and last
|
||||
// patch ends at nActiveFaces) and change patches with addPatches.
|
||||
void resetPrimitives
|
||||
(
|
||||
const label nUsedFaces,
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
const labelList& owner,
|
||||
const labelList& neighbour,
|
||||
const labelList& patchSizes,
|
||||
const labelList& patchStarts,
|
||||
const bool validBoundary = true
|
||||
);
|
||||
|
||||
//- Reset mesh primitive data. Assumes all patch info correct
|
||||
// (so does e.g. parallel communication). If not use
|
||||
// validBoundary=false
|
||||
|
||||
Reference in New Issue
Block a user