Implement and export SplineGeometry2d::SetDomainTensorMeshing

This commit is contained in:
Matthias Hochsteger 2020-06-08 10:39:31 +02:00
parent efbd71c8d5
commit 5bea3bb612
2 changed files with 14 additions and 2 deletions

View File

@ -133,7 +133,7 @@ namespace netgen
NgArray<char*> materials;
NgArray<double> maxh;
NgArray<bool> quadmeshing;
NgArray<bool> tensormeshing;
Array<bool> tensormeshing;
NgArray<int> layer;
NgArray<string*> bcnames;
double elto0 = 1.0;
@ -216,9 +216,20 @@ namespace netgen
}
bool GetDomainTensorMeshing ( int domnr )
{
if ( tensormeshing.Size() ) return tensormeshing[domnr-1];
if ( tensormeshing.Size()>=domnr ) return tensormeshing[domnr-1];
else return false;
}
void SetDomainTensorMeshing ( int domnr, bool tm )
{
if ( tensormeshing.Size()<domnr )
{
auto oldsize = tensormeshing.Size();
tensormeshing.SetSize(domnr);
for(auto i : IntRange(oldsize, domnr-1))
tensormeshing[i] = false;
}
tensormeshing[domnr-1] = tm;
}
int GetDomainLayer ( int domnr )
{
if ( layer.Size() ) return layer[domnr-1];

View File

@ -392,6 +392,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
}, py::arg("mp") = nullptr,
py::call_guard<py::gil_scoped_release>(),
meshingparameter_description.c_str())
.def("_SetDomainTensorMeshing", &SplineGeometry2d::SetDomainTensorMeshing)
;
}