mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
Merge branch 'fix_oneside_hpref' into 'master'
Fix oneside hpref See merge request jschoeberl/netgen!237
This commit is contained in:
commit
e887a2862b
@ -63,7 +63,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
|
||||
py::arg("x"), py::arg("y"), py::arg("maxh") = 1e99, py::arg("hpref")=0, py::arg("name")="")
|
||||
.def("Append", FunctionPointer([](SplineGeometry2d &self, py::list segment, int leftdomain, int rightdomain,
|
||||
optional<variant<int, string>> bc, optional<int> copy, double maxh,
|
||||
double hpref)
|
||||
double hpref, double hprefleft, double hprefright)
|
||||
{
|
||||
auto segtype = py::cast<std::string>(segment[0]);
|
||||
|
||||
@ -86,8 +86,8 @@ DLL_HEADER void ExportGeom2d(py::module &m)
|
||||
seg->leftdom = leftdomain;
|
||||
seg->rightdom = rightdomain;
|
||||
seg->hmax = maxh;
|
||||
seg->hpref_left = hpref;
|
||||
seg->hpref_right = hpref;
|
||||
seg->hpref_left = max(hpref, hprefleft);
|
||||
seg->hpref_right = max(hpref,hprefright);
|
||||
seg->reffak = 1;
|
||||
seg->copyfrom = -1;
|
||||
if (copy.has_value())
|
||||
@ -110,7 +110,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
|
||||
return self.GetNSplines()-1;
|
||||
}), py::arg("point_indices"), py::arg("leftdomain") = 1, py::arg("rightdomain") = py::int_(0),
|
||||
py::arg("bc")=nullopt, py::arg("copy")=nullopt, py::arg("maxh")=1e99,
|
||||
py::arg("hpref")=0)
|
||||
py::arg("hpref")=0,py::arg("hprefleft")=0,py::arg("hprefright")=0)
|
||||
|
||||
|
||||
.def("AppendSegment", FunctionPointer([](SplineGeometry2d &self, py::list point_indices, int leftdomain, int rightdomain)
|
||||
|
@ -761,11 +761,10 @@ HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE<int> & edge
|
||||
int ep1=p[eledges[k][0]-1];
|
||||
int ep2=p[eledges[k][1]-1];
|
||||
|
||||
INDEX_2 i2(el.PNum(ep1),el.PNum(ep2));
|
||||
INDEX_2 i2 = INDEX_2::Sort(el.PNum(ep1),el.PNum(ep2));
|
||||
|
||||
if(edges.Used(i2))
|
||||
{
|
||||
|
||||
if(edgepoint_dom.Used(INDEX_2(fd.SurfNr(),pnums[ep1-1])) ||
|
||||
edgepoint_dom.Used(INDEX_2(-1,pnums[ep1-1])) ||
|
||||
edgepoint_dom.Used(INDEX_2(fd.SurfNr(),pnums[ep2-1])) ||
|
||||
@ -783,7 +782,7 @@ HPREF_ELEMENT_TYPE ClassifyTrig(HPRefElement & el, INDEX_2_HASHTABLE<int> & edge
|
||||
|
||||
|
||||
for(int k=0;k<3;k++)
|
||||
if(edgepoint.Test(pnums[k])) //edgepoint, but not member of sing_edge on trig -> cp
|
||||
if(edgepoint.Test(pnums[k]) && (edgepoint_dom.Used(INDEX_2(fd.SurfNr(),pnums[k])) || edgepoint_dom.Used(INDEX_2(-1,pnums[k])))) //edgepoint, but not member of sing_edge on trig -> cp
|
||||
{
|
||||
INDEX_2 i2a=INDEX_2::Sort(el.PNum(p[k]), el.PNum(p[(k+1)%3]));
|
||||
INDEX_2 i2b=INDEX_2::Sort(el.PNum(p[k]), el.PNum(p[(k+2)%3]));
|
||||
|
@ -1722,7 +1722,7 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE<int> & edges, INDEX_2_HAS
|
||||
|
||||
if (seg.singedge_left * levels >= act_ref)
|
||||
{
|
||||
INDEX_2 i2 (mesh.LineSegment(i)[0],
|
||||
INDEX_2 i2 = INDEX_2::Sort(mesh.LineSegment(i)[0],
|
||||
mesh.LineSegment(i)[1]);
|
||||
edges.Set(i2,1);
|
||||
edgepoint.Set(i2.I1());
|
||||
@ -1738,7 +1738,7 @@ bool CheckSingularities(Mesh & mesh, INDEX_2_HASHTABLE<int> & edges, INDEX_2_HAS
|
||||
|
||||
if (seg.singedge_right * levels >= act_ref)
|
||||
{
|
||||
INDEX_2 i2 (mesh.LineSegment(i)[1],
|
||||
INDEX_2 i2 = INDEX_2::Sort(mesh.LineSegment(i)[1],
|
||||
mesh.LineSegment(i)[0]);
|
||||
edges.Set (i2, 1);
|
||||
edgepoint.Set(i2.I1());
|
||||
|
Loading…
Reference in New Issue
Block a user