mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
Fix ImproveMesh
This commit is contained in:
parent
298cbc2523
commit
f5432718c1
@ -521,7 +521,7 @@ void MeshOptimize3d :: CombineImprove (Mesh & mesh,
|
|||||||
|
|
||||||
// return CombineImproveSequential(mesh, goal);
|
// return CombineImproveSequential(mesh, goal);
|
||||||
|
|
||||||
mesh.BoundaryEdge (1,2); // ensure the boundary-elements table is built
|
mesh.BuildBoundaryEdges(false);
|
||||||
|
|
||||||
int np = mesh.GetNP();
|
int np = mesh.GetNP();
|
||||||
int ne = mesh.GetNE();
|
int ne = mesh.GetNE();
|
||||||
@ -817,7 +817,7 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
|
|||||||
|
|
||||||
PrintMessage (3, "SplitImprove");
|
PrintMessage (3, "SplitImprove");
|
||||||
(*testout) << "start SplitImprove" << "\n";
|
(*testout) << "start SplitImprove" << "\n";
|
||||||
mesh.BoundaryEdge (1,2); // ensure the boundary-elements table is built
|
mesh.BuildBoundaryEdges(false);
|
||||||
|
|
||||||
ParallelFor( mesh.VolumeElements().Range(), [&] (ElementIndex ei) NETGEN_LAMBDA_INLINE
|
ParallelFor( mesh.VolumeElements().Range(), [&] (ElementIndex ei) NETGEN_LAMBDA_INLINE
|
||||||
{
|
{
|
||||||
@ -2713,7 +2713,7 @@ void MeshOptimize3d :: SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal,
|
|||||||
int np = mesh.GetNP();
|
int np = mesh.GetNP();
|
||||||
int ne = mesh.GetNE();
|
int ne = mesh.GetNE();
|
||||||
|
|
||||||
mesh.BoundaryEdge (1,2); // ensure the boundary-elements table is built
|
mesh.BuildBoundaryEdges(false);
|
||||||
|
|
||||||
auto elementsonnode = mesh.CreatePoint2ElementTable();
|
auto elementsonnode = mesh.CreatePoint2ElementTable();
|
||||||
|
|
||||||
@ -3932,7 +3932,7 @@ void MeshOptimize3d :: SwapImprove2 (Mesh & mesh, OPTIMIZEGOAL goal)
|
|||||||
|
|
||||||
// return SwapImprove2Sequential(mesh, goal);
|
// return SwapImprove2Sequential(mesh, goal);
|
||||||
|
|
||||||
mesh.BoundaryEdge (1,2); // ensure the boundary-elements table is built
|
mesh.BuildBoundaryEdges(false);
|
||||||
|
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
double bad1, bad2;
|
double bad1, bad2;
|
||||||
@ -4177,7 +4177,7 @@ void MeshOptimize3d :: SplitImprove2 (Mesh & mesh)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mesh.BoundaryEdge (1,2); // ensure the boundary-elements table is built
|
mesh.BuildBoundaryEdges(false);
|
||||||
|
|
||||||
Array<std::tuple<double, ElementIndex>> split_candidates(ne);
|
Array<std::tuple<double, ElementIndex>> split_candidates(ne);
|
||||||
std::atomic<int> improvement_counter(0);
|
std::atomic<int> improvement_counter(0);
|
||||||
|
@ -1794,12 +1794,12 @@ namespace netgen
|
|||||||
volelements.SetAllocSize(nel);
|
volelements.SetAllocSize(nel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mesh :: BuildBoundaryEdges(bool rebuild)
|
||||||
void Mesh :: BuildBoundaryEdges(void)
|
|
||||||
{
|
{
|
||||||
static Timer t("Mesh::BuildBoundaryEdges"); RegionTimer reg(t);
|
static Timer t("Mesh::BuildBoundaryEdges"); RegionTimer reg(t);
|
||||||
|
|
||||||
// delete boundaryedges;
|
if(!rebuild && boundaryedges)
|
||||||
|
return;
|
||||||
|
|
||||||
boundaryedges = make_unique<INDEX_2_CLOSED_HASHTABLE<int>>
|
boundaryedges = make_unique<INDEX_2_CLOSED_HASHTABLE<int>>
|
||||||
(3 * (GetNSE() + GetNOpenElements()) + GetNSeg() + 1);
|
(3 * (GetNSE() + GetNOpenElements()) + GetNSeg() + 1);
|
||||||
|
@ -156,10 +156,10 @@ namespace netgen
|
|||||||
|
|
||||||
shared_ptr<NetgenGeometry> geometry;
|
shared_ptr<NetgenGeometry> geometry;
|
||||||
|
|
||||||
private:
|
|
||||||
void BuildBoundaryEdges(void);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
void BuildBoundaryEdges(bool rebuild=true);
|
||||||
|
|
||||||
bool PointContainedIn2DElement(const Point3d & p,
|
bool PointContainedIn2DElement(const Point3d & p,
|
||||||
double lami[3],
|
double lami[3],
|
||||||
const int element,
|
const int element,
|
||||||
|
@ -1460,6 +1460,7 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal)
|
|||||||
static Timer trange("range");
|
static Timer trange("range");
|
||||||
|
|
||||||
// return ImproveMeshSequential(mp, goal);
|
// return ImproveMeshSequential(mp, goal);
|
||||||
|
BuildBoundaryEdges(false);
|
||||||
|
|
||||||
(*testout) << "Improve Mesh" << "\n";
|
(*testout) << "Improve Mesh" << "\n";
|
||||||
PrintMessage (3, "ImproveMesh");
|
PrintMessage (3, "ImproveMesh");
|
||||||
|
Loading…
Reference in New Issue
Block a user