use (double) factor for 2D hprefinement for strength of geometric refinement

This commit is contained in:
Joachim Schöberl 2017-10-03 06:33:39 +02:00
parent 9b0e13730f
commit 60c80fe9fc
5 changed files with 12 additions and 12 deletions

View File

@ -375,7 +375,7 @@ DLL_HEADER void ExportCSG(py::module &m)
}))
.def("Add",
[] (CSGeometry & self, shared_ptr<SPSolid> solid, py::list bcmod, double maxh,
py::tuple col, bool transparent)
py::tuple col, bool transparent, int layer)
{
solid->AddSurfaces (self);
solid->GiveUpOwner();
@ -385,6 +385,7 @@ DLL_HEADER void ExportCSG(py::module &m)
// self.GetTopLevelObject(tlonr)->SetTransparent(solid->IsTransparent());
self.GetTopLevelObject(tlonr)->SetTransparent(transparent);
self.GetTopLevelObject(tlonr)->SetMaxH(maxh);
self.GetTopLevelObject(tlonr)->SetLayer(layer);
// cout << "rgb = " << py::len(rgb) << endl;
if (py::len(col)==3)
@ -421,7 +422,7 @@ DLL_HEADER void ExportCSG(py::module &m)
return tlonr;
},
py::arg("solid"), py::arg("bcmod")=py::list(), py::arg("maxh")=1e99,
py::arg("col")=py::tuple(), py::arg("transparent")=false
py::arg("col")=py::tuple(), py::arg("transparent")=false, py::arg("layer")=1
)
.def("AddSurface", FunctionPointer

View File

@ -416,7 +416,7 @@ namespace netgen
mpi = pi;
mindist = Dist2(gp3, (*mesh)[pi]);
}
(*mesh)[mpi].Singularity(1.);
(*mesh)[mpi].Singularity(geometry.GetPoint(i).hpref);
}

View File

@ -36,9 +36,9 @@ namespace netgen
/// copy spline mesh from other spline (-1.. do not copy)
int copyfrom;
/// perfrom anisotropic refinement (hp-refinement) to edge
bool hpref_left;
double hpref_left;
/// perfrom anisotropic refinement (hp-refinement) to edge
bool hpref_right;
double hpref_right;
///
int layer;

View File

@ -31,7 +31,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
.def("Load",&SplineGeometry2d::Load)
.def("AppendPoint", FunctionPointer
([](SplineGeometry2d &self, double px, double py, double maxh, bool hpref)
([](SplineGeometry2d &self, double px, double py, double maxh, double hpref)
{
Point<2> p;
p(0) = px;
@ -42,9 +42,9 @@ DLL_HEADER void ExportGeom2d(py::module &m)
self.geompoints.Append(gp);
return self.geompoints.Size()-1;
}),
py::arg("x"), py::arg("y"), py::arg("maxh") = 1e99, py::arg("hpref")=false)
py::arg("x"), py::arg("y"), py::arg("maxh") = 1e99, py::arg("hpref")=0)
.def("Append", FunctionPointer([](SplineGeometry2d &self, py::list segment, int leftdomain, int rightdomain,
py::object bc, py::object copy, double maxh, bool hpref)
py::object bc, py::object copy, double maxh, double hpref)
{
py::extract<std::string> segtype(segment[0]);
@ -96,8 +96,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
self.AppendSegment(seg);
return self.GetNSplines()-1;
}), py::arg("point_indices"), py::arg("leftdomain") = 1, py::arg("rightdomain") = py::int_(0),
py::arg("bc")=NGDummyArgument(), py::arg("copy")=NGDummyArgument(), py::arg("maxh")=1e99, py::arg("hpref")=false
)
py::arg("bc")=NGDummyArgument(), py::arg("copy")=NGDummyArgument(), py::arg("maxh")=1e99, py::arg("hpref")=0)
.def("AppendSegment", FunctionPointer([](SplineGeometry2d &self, py::list point_indices, int leftdomain, int rightdomain)

View File

@ -27,13 +27,13 @@ namespace netgen
/// max mesh-size at point
double hmax;
/// hp-refinement
bool hpref;
double hpref;
///
GeomPoint () { ; }
///
GeomPoint (const Point<D> & ap, double aref = 1, bool ahpref=false)
GeomPoint (const Point<D> & ap, double aref = 1, double ahpref=0)
: Point<D>(ap), refatpoint(aref), hmax(1e99), hpref(ahpref) { ; }
};