mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 14:10:34 +05:00
throw if IdentifyBoundaries mapped point is outside of mesh
This commit is contained in:
parent
585a2e086c
commit
e3f95528e0
@ -6261,6 +6261,8 @@ namespace netgen
|
|||||||
auto mapped_pt = mapping(pt);
|
auto mapped_pt = mapping(pt);
|
||||||
auto other_nr = GetElementOfPoint(mapped_pt, lami, true);
|
auto other_nr = GetElementOfPoint(mapped_pt, lami, true);
|
||||||
int index = -1;
|
int index = -1;
|
||||||
|
if(other_nr != 0)
|
||||||
|
{
|
||||||
auto other_el = VolumeElement(other_nr);
|
auto other_el = VolumeElement(other_nr);
|
||||||
for(auto i : Range(other_el.PNums().Size()))
|
for(auto i : Range(other_el.PNums().Size()))
|
||||||
if((mapped_pt - (*this)[other_el.PNums()[i]]).Length() < pointTolerance)
|
if((mapped_pt - (*this)[other_el.PNums()[i]]).Length() < pointTolerance)
|
||||||
@ -6278,6 +6280,13 @@ namespace netgen
|
|||||||
identified_points.insert(pi);
|
identified_points.insert(pi);
|
||||||
ident->Add(pi, other_pi, nr);
|
ident->Add(pi, other_pi, nr);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << "point coordinates = " << pt << endl;
|
||||||
|
cout << "mapped coordinates = " << mapped_pt << endl;
|
||||||
|
throw Exception("Mapped point with nr " + ToString(pi) + " is outside of mesh, are you sure your mesh is periodic?");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nr;
|
return nr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user