mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +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.task_manager = task_manager;
|
||||||
biopt.tracer = tracer;
|
biopt.tracer = tracer;
|
||||||
|
|
||||||
if(mesh->GetGeometry())
|
mesh->GetGeometry()->GetRefinement().Bisect (*mesh, biopt);
|
||||||
mesh->GetGeometry()->GetRefinement().Bisect (*mesh, biopt);
|
|
||||||
else
|
|
||||||
Refinement().Bisect(*mesh, biopt);
|
|
||||||
(*tracer)("call updatetop", false);
|
(*tracer)("call updatetop", false);
|
||||||
mesh -> UpdateTopology(task_manager, tracer);
|
mesh -> UpdateTopology(task_manager, tracer);
|
||||||
(*tracer)("call updatetop", true);
|
(*tracer)("call updatetop", true);
|
||||||
|
@ -797,8 +797,9 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
shared_ptr<NetgenGeometry> GetGeometry() const
|
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)
|
void SetGeometry (shared_ptr<NetgenGeometry> geom)
|
||||||
{
|
{
|
||||||
|
@ -63,10 +63,7 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
if (secondorder)
|
if (secondorder)
|
||||||
{
|
{
|
||||||
if (mesh.GetGeometry())
|
mesh.GetGeometry()->GetRefinement().MakeSecondOrder(mesh);
|
||||||
mesh.GetGeometry()->GetRefinement().MakeSecondOrder(mesh);
|
|
||||||
else
|
|
||||||
Refinement().MakeSecondOrder(mesh);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -890,20 +890,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
.def ("Refine", FunctionPointer
|
.def ("Refine", FunctionPointer
|
||||||
([](Mesh & self)
|
([](Mesh & self)
|
||||||
{
|
{
|
||||||
if (self.GetGeometry())
|
self.GetGeometry()->GetRefinement().Refine(self);
|
||||||
self.GetGeometry()->GetRefinement().Refine(self);
|
|
||||||
else
|
|
||||||
Refinement().Refine(self);
|
|
||||||
self.UpdateTopology();
|
self.UpdateTopology();
|
||||||
}),py::call_guard<py::gil_scoped_release>())
|
}),py::call_guard<py::gil_scoped_release>())
|
||||||
|
|
||||||
.def ("SecondOrder", FunctionPointer
|
.def ("SecondOrder", FunctionPointer
|
||||||
([](Mesh & self)
|
([](Mesh & self)
|
||||||
{
|
{
|
||||||
if (self.GetGeometry())
|
self.GetGeometry()->GetRefinement().MakeSecondOrder(self);
|
||||||
self.GetGeometry()->GetRefinement().MakeSecondOrder(self);
|
|
||||||
else
|
|
||||||
Refinement().MakeSecondOrder(self);
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
.def ("GetGeometry", [] (Mesh& self) { return self.GetGeometry(); })
|
.def ("GetGeometry", [] (Mesh& self) { return self.GetGeometry(); })
|
||||||
|
Loading…
Reference in New Issue
Block a user