mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
return default geometry if no geometry is set for mesh
This commit is contained in:
parent
ec5ec39909
commit
8ae2475085
@ -1164,10 +1164,7 @@ namespace netgen
|
||||
biopt.task_manager = task_manager;
|
||||
biopt.tracer = tracer;
|
||||
|
||||
if(mesh->GetGeometry())
|
||||
mesh->GetGeometry()->GetRefinement().Bisect (*mesh, biopt);
|
||||
else
|
||||
Refinement().Bisect(*mesh, biopt);
|
||||
mesh->GetGeometry()->GetRefinement().Bisect (*mesh, biopt);
|
||||
(*tracer)("call updatetop", false);
|
||||
mesh -> UpdateTopology(task_manager, tracer);
|
||||
(*tracer)("call updatetop", true);
|
||||
|
@ -797,8 +797,9 @@ namespace netgen
|
||||
|
||||
|
||||
shared_ptr<NetgenGeometry> GetGeometry() const
|
||||
{
|
||||
return geometry;
|
||||
{
|
||||
static auto global_geometry = make_shared<NetgenGeometry>();
|
||||
return geometry ? geometry : global_geometry;
|
||||
}
|
||||
void SetGeometry (shared_ptr<NetgenGeometry> geom)
|
||||
{
|
||||
|
@ -63,10 +63,7 @@ namespace netgen
|
||||
}
|
||||
if (secondorder)
|
||||
{
|
||||
if (mesh.GetGeometry())
|
||||
mesh.GetGeometry()->GetRefinement().MakeSecondOrder(mesh);
|
||||
else
|
||||
Refinement().MakeSecondOrder(mesh);
|
||||
mesh.GetGeometry()->GetRefinement().MakeSecondOrder(mesh);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -890,20 +890,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
.def ("Refine", FunctionPointer
|
||||
([](Mesh & self)
|
||||
{
|
||||
if (self.GetGeometry())
|
||||
self.GetGeometry()->GetRefinement().Refine(self);
|
||||
else
|
||||
Refinement().Refine(self);
|
||||
self.GetGeometry()->GetRefinement().Refine(self);
|
||||
self.UpdateTopology();
|
||||
}),py::call_guard<py::gil_scoped_release>())
|
||||
|
||||
.def ("SecondOrder", FunctionPointer
|
||||
([](Mesh & self)
|
||||
{
|
||||
if (self.GetGeometry())
|
||||
self.GetGeometry()->GetRefinement().MakeSecondOrder(self);
|
||||
else
|
||||
Refinement().MakeSecondOrder(self);
|
||||
self.GetGeometry()->GetRefinement().MakeSecondOrder(self);
|
||||
}))
|
||||
|
||||
.def ("GetGeometry", [] (Mesh& self) { return self.GetGeometry(); })
|
||||
|
Loading…
Reference in New Issue
Block a user