Skip to content

Commit

Permalink
Merge branch 'global_localheap_reset_when_used' into 'master'
Browse files Browse the repository at this point in the history
reset local heap after use (__call__ of coeffcts.)

See merge request jschoeberl/ngsolve!289
  • Loading branch information
JSchoeberl committed Jan 23, 2018
2 parents 8f64933 + 09efa08 commit 13ea6af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comp/python_comp.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2205,6 +2205,7 @@ used_idnrs : list of int = None
.def("__call__", .def("__call__",
[](shared_ptr<GF> self, double x, double y, double z) [](shared_ptr<GF> self, double x, double y, double z)
{ {
HeapReset hr(glh);
auto space = self->GetFESpace(); auto space = self->GetFESpace();
auto evaluator = space->GetEvaluator(); auto evaluator = space->GetEvaluator();
IntegrationPoint ip; IntegrationPoint ip;
Expand Down Expand Up @@ -2243,6 +2244,7 @@ used_idnrs : list of int = None
.def("__call__", .def("__call__",
[](shared_ptr<GF> self, const BaseMappedIntegrationPoint & mip) [](shared_ptr<GF> self, const BaseMappedIntegrationPoint & mip)
{ {
HeapReset hr(glh);
auto space = self->GetFESpace(); auto space = self->GetFESpace();


ElementId ei = mip.GetTransformation().GetElementId(); ElementId ei = mip.GetTransformation().GetElementId();
Expand Down Expand Up @@ -2279,6 +2281,7 @@ used_idnrs : list of int = None
.def("D", .def("D",
[](shared_ptr<GF> self, const double &x, const double &y, const double &z) [](shared_ptr<GF> self, const double &x, const double &y, const double &z)
{ {
HeapReset hr(glh);
const FESpace & space = *self->GetFESpace(); const FESpace & space = *self->GetFESpace();
IntegrationPoint ip; IntegrationPoint ip;
int dim_mesh = space.GetMeshAccess()->GetDimension(); int dim_mesh = space.GetMeshAccess()->GetDimension();
Expand Down

0 comments on commit 13ea6af

Please sign in to comment.