Curve mesh functionality over Ngx_Mesh

This commit is contained in:
Joachim Schöberl 2018-05-01 21:20:54 +02:00
parent 1629d6bf69
commit 66ef426c79
5 changed files with 27 additions and 1 deletions

View File

@ -276,6 +276,7 @@ namespace netgen
// 3D only
// std::pair<int,int> GetBoundaryNeighbouringDomains (int bnr);
DLL_HEADER void Curve (int order);
void Refine (NG_REFINEMENT_TYPE reftype,
void (*taskmanager)(function<void(int,int)>) = &DummyTaskManager2,
void (*tracer)(string, bool) = &DummyTracer2);

View File

@ -1105,13 +1105,15 @@ void Ng_HighOrder (int order, bool rational)
(&const_cast<Refinement&> (ng_geometry -> GetRefinement()),
order, rational);
*/
/*
if (!mesh->GetGeometry())
throw NgException ("don't have a geometry for mesh curving");
mesh->BuildCurvedElements
(&const_cast<Refinement&> (mesh->GetGeometry()->GetRefinement()),
order, rational);
mesh -> SetNextMajorTimeStamp();
*/
mesh->BuildCurvedElements(order);
}

View File

@ -1040,6 +1040,11 @@ namespace netgen
return ind-1;
}
void Ngx_Mesh :: Curve (int order)
{
NgLock meshlock (mesh->MajorMutex(), true);
mesh->BuildCurvedElements(order);
}
void Ngx_Mesh :: Refine (NG_REFINEMENT_TYPE reftype,
void (*task_manager)(function<void(int,int)>),

View File

@ -5835,6 +5835,23 @@ namespace netgen
SetNextMajorTimeStamp();
}
void Mesh :: BuildCurvedElements (int aorder)
{
if (!GetGeometry())
throw NgException ("don't have a geometry for mesh curving");
GetCurvedElements().BuildCurvedElements (&GetGeometry()->GetRefinement(), aorder, false);
for (SegmentIndex seg = 0; seg < GetNSeg(); seg++)
(*this)[seg].SetCurved (GetCurvedElements().IsSegmentCurved (seg));
for (SurfaceElementIndex sei = 0; sei < GetNSE(); sei++)
(*this)[sei].SetCurved (GetCurvedElements().IsSurfaceElementCurved (sei));
for (ElementIndex ei = 0; ei < GetNE(); ei++)
(*this)[ei].SetCurved (GetCurvedElements().IsElementCurved (ei));
SetNextMajorTimeStamp();
}
void Mesh :: SetMaterial (int domnr, const string & mat)
{
if (domnr > materials.Size())

View File

@ -716,6 +716,7 @@ namespace netgen
{ return *curvedelems; }
DLL_HEADER void BuildCurvedElements (const class Refinement * ref, int aorder, bool arational = false);
DLL_HEADER void BuildCurvedElements (int aorder);
const class AnisotropicClusters & GetClusters () const
{ return *clusters; }