mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
remove warnings
This commit is contained in:
parent
ec0f848030
commit
87b65fb5ff
@ -50,7 +50,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int nvert;
|
int nvert;
|
||||||
fin >> nvert;
|
fin >> nvert;
|
||||||
Point<3> p{0.,0.,0.};
|
Point<3> p{0.,0.,0.};
|
||||||
for(auto k : Range(nvert)) {
|
for([[maybe_unused]] auto k : Range(nvert)) {
|
||||||
for(auto i : Range(dim))
|
for(auto i : Range(dim))
|
||||||
fin >> p[i];
|
fin >> p[i];
|
||||||
fin >> index;
|
fin >> index;
|
||||||
@ -61,7 +61,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int nedge;
|
int nedge;
|
||||||
fin >> nedge;
|
fin >> nedge;
|
||||||
Segment seg;
|
Segment seg;
|
||||||
for(auto k : Range(nedge)) {
|
for([[maybe_unused]] auto k : Range(nedge)) {
|
||||||
for(auto i : Range(2))
|
for(auto i : Range(2))
|
||||||
fin >> seg[i];
|
fin >> seg[i];
|
||||||
fin >> seg.edgenr;
|
fin >> seg.edgenr;
|
||||||
@ -74,7 +74,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int ntrig, index;
|
int ntrig, index;
|
||||||
fin >> ntrig;
|
fin >> ntrig;
|
||||||
Element2d sel;
|
Element2d sel;
|
||||||
for(auto k : Range(ntrig)) {
|
for([[maybe_unused]] auto k : Range(ntrig)) {
|
||||||
for(auto i : Range(3))
|
for(auto i : Range(3))
|
||||||
fin >> sel[i];
|
fin >> sel[i];
|
||||||
fin >> index;
|
fin >> index;
|
||||||
@ -86,7 +86,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int ntet;
|
int ntet;
|
||||||
fin >> ntet;
|
fin >> ntet;
|
||||||
Element el(4);
|
Element el(4);
|
||||||
for(auto k : Range(ntet)) {
|
for([[maybe_unused]] auto k : Range(ntet)) {
|
||||||
for(auto i : Range(4))
|
for(auto i : Range(4))
|
||||||
fin >> el[i];
|
fin >> el[i];
|
||||||
fin >> index;
|
fin >> index;
|
||||||
@ -99,7 +99,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int ncorners;
|
int ncorners;
|
||||||
fin >> ncorners;
|
fin >> ncorners;
|
||||||
Element0d el;
|
Element0d el;
|
||||||
for(auto k : Range(ncorners)) {
|
for([[maybe_unused]] auto k : Range(ncorners)) {
|
||||||
fin >> el.pnum;
|
fin >> el.pnum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int nverts;
|
int nverts;
|
||||||
fin >> nverts;
|
fin >> nverts;
|
||||||
int vert;
|
int vert;
|
||||||
for(auto k : Range(nverts)) {
|
for([[maybe_unused]] auto k : Range(nverts)) {
|
||||||
fin >> vert;
|
fin >> vert;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int nnormals;
|
int nnormals;
|
||||||
fin >> nnormals;
|
fin >> nnormals;
|
||||||
Vec<3> normal;
|
Vec<3> normal;
|
||||||
for(auto k : Range(nnormals)) {
|
for([[maybe_unused]] auto k : Range(nnormals)) {
|
||||||
fin >> normal[0];
|
fin >> normal[0];
|
||||||
fin >> normal[1];
|
fin >> normal[1];
|
||||||
fin >> normal[2];
|
fin >> normal[2];
|
||||||
@ -126,7 +126,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
fin >> nnormals;
|
fin >> nnormals;
|
||||||
int vert;
|
int vert;
|
||||||
int normal;
|
int normal;
|
||||||
for(auto k : Range(nnormals)) {
|
for([[maybe_unused]] auto k : Range(nnormals)) {
|
||||||
fin >> normal;
|
fin >> normal;
|
||||||
fin >> vert;
|
fin >> vert;
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int ntangents;
|
int ntangents;
|
||||||
fin >> ntangents;
|
fin >> ntangents;
|
||||||
Vec<3> tangent;
|
Vec<3> tangent;
|
||||||
for(auto k : Range(ntangents)) {
|
for([[maybe_unused]] auto k : Range(ntangents)) {
|
||||||
fin >> tangent[0];
|
fin >> tangent[0];
|
||||||
fin >> tangent[1];
|
fin >> tangent[1];
|
||||||
fin >> tangent[2];
|
fin >> tangent[2];
|
||||||
@ -146,7 +146,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
fin >> ntangents;
|
fin >> ntangents;
|
||||||
int vert;
|
int vert;
|
||||||
int tangent;
|
int tangent;
|
||||||
for(auto k : Range(ntangents)) {
|
for([[maybe_unused]] auto k : Range(ntangents)) {
|
||||||
fin >> tangent;
|
fin >> tangent;
|
||||||
fin >> vert;
|
fin >> vert;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int nridges;
|
int nridges;
|
||||||
fin >> nridges;
|
fin >> nridges;
|
||||||
int ridge;
|
int ridge;
|
||||||
for(auto k : Range(nridges)) {
|
for([[maybe_unused]] auto k : Range(nridges)) {
|
||||||
fin >> ridge;
|
fin >> ridge;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ void ReadMeditFormat (Mesh & mesh, const filesystem::path & filename, map<tuple<
|
|||||||
int nitems;
|
int nitems;
|
||||||
fin >> nitems;
|
fin >> nitems;
|
||||||
string s;
|
string s;
|
||||||
for(auto i : Range(nitems))
|
for([[maybe_unused]] auto i : Range(nitems))
|
||||||
fin >> s; // read one line
|
fin >> s; // read one line
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -829,7 +829,7 @@ namespace netgen
|
|||||||
if(face.primary == &face)
|
if(face.primary == &face)
|
||||||
{
|
{
|
||||||
// check if this face connects two identified closesurfaces
|
// check if this face connects two identified closesurfaces
|
||||||
auto & idents = mesh.GetIdentifications();
|
// auto & idents = mesh.GetIdentifications();
|
||||||
std::set<int> relevant_edges;
|
std::set<int> relevant_edges;
|
||||||
auto segments = face.GetBoundary(mesh);
|
auto segments = face.GetBoundary(mesh);
|
||||||
for(const auto &s : segments)
|
for(const auto &s : segments)
|
||||||
|
@ -66,7 +66,7 @@ namespace netgen
|
|||||||
auto p0 = larger_trig[i];
|
auto p0 = larger_trig[i];
|
||||||
auto p1 = larger_trig[(i+1)%3];
|
auto p1 = larger_trig[(i+1)%3];
|
||||||
auto p2 = larger_trig[(i+2)%3];
|
auto p2 = larger_trig[(i+2)%3];
|
||||||
auto n = Cross(p2-p1, n_trig);
|
// auto n = Cross(p2-p1, n_trig);
|
||||||
|
|
||||||
auto v0 = (p2-p1).Normalize();
|
auto v0 = (p2-p1).Normalize();
|
||||||
auto v1 = (p0-p1).Normalize();
|
auto v1 = (p0-p1).Normalize();
|
||||||
@ -209,7 +209,7 @@ namespace netgen
|
|||||||
Vec<3> ab_base_norm = (b_base - a_base).Normalize();
|
Vec<3> ab_base_norm = (b_base - a_base).Normalize();
|
||||||
double a_vec_x = Dot(a_vec, ab_base_norm);
|
double a_vec_x = Dot(a_vec, ab_base_norm);
|
||||||
double b_vec_x = Dot(b_vec, -ab_base_norm);
|
double b_vec_x = Dot(b_vec, -ab_base_norm);
|
||||||
double ratio_parallel = (a_vec_x + b_vec_x) / ab_base;
|
// double ratio_parallel = (a_vec_x + b_vec_x) / ab_base;
|
||||||
|
|
||||||
// Calculate surface normal at point si
|
// Calculate surface normal at point si
|
||||||
Vec<3> surface_normal = getNormal(mesh[si]);
|
Vec<3> surface_normal = getNormal(mesh[si]);
|
||||||
@ -238,7 +238,7 @@ namespace netgen
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto modifiedsmooth = [&](size_t nsteps) {
|
auto modifiedsmooth = [&](size_t nsteps) {
|
||||||
for (auto i : Range(nsteps))
|
for ([[maybe_unused]] auto i : Range(nsteps))
|
||||||
for (SurfaceElementIndex sei : mesh.SurfaceElements().Range())
|
for (SurfaceElementIndex sei : mesh.SurfaceElements().Range())
|
||||||
{
|
{
|
||||||
// assuming triangle
|
// assuming triangle
|
||||||
@ -248,8 +248,9 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
auto smooth = [&] (size_t nsteps) {
|
auto smooth = [&] (size_t nsteps) {
|
||||||
for(auto i : Range(nsteps))
|
for([[maybe_unused]] auto i : Range(nsteps))
|
||||||
for(const auto & sel : mesh.SurfaceElements())
|
for(const auto & sel : mesh.SurfaceElements())
|
||||||
{
|
{
|
||||||
double min_limit = 999;
|
double min_limit = 999;
|
||||||
@ -259,7 +260,8 @@ namespace netgen
|
|||||||
limits[pi] = min(limits[pi], 1.4*min_limit);
|
limits[pi] = min(limits[pi], 1.4*min_limit);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
// check for self-intersection within new elements (prisms/hexes)
|
// check for self-intersection within new elements (prisms/hexes)
|
||||||
auto self_intersection = [&] () {
|
auto self_intersection = [&] () {
|
||||||
for(SurfaceElementIndex sei : mesh.SurfaceElements().Range())
|
for(SurfaceElementIndex sei : mesh.SurfaceElements().Range())
|
||||||
@ -446,7 +448,7 @@ namespace netgen
|
|||||||
Array<Segment> BuildSegments( Mesh & mesh )
|
Array<Segment> BuildSegments( Mesh & mesh )
|
||||||
{
|
{
|
||||||
Array<Segment> segments;
|
Array<Segment> segments;
|
||||||
auto& topo = mesh.GetTopology();
|
// auto& topo = mesh.GetTopology();
|
||||||
|
|
||||||
NgArray<SurfaceElementIndex> surf_els;
|
NgArray<SurfaceElementIndex> surf_els;
|
||||||
|
|
||||||
@ -550,13 +552,13 @@ namespace netgen
|
|||||||
|
|
||||||
// smooth tangential part of growth vectors from edges to surface elements
|
// smooth tangential part of growth vectors from edges to surface elements
|
||||||
RegionTimer rtsmooth(tsmooth);
|
RegionTimer rtsmooth(tsmooth);
|
||||||
for(auto i : Range(10))
|
for([[maybe_unused]] auto i : Range(10))
|
||||||
{
|
{
|
||||||
for(auto pi : points)
|
for(auto pi : points)
|
||||||
{
|
{
|
||||||
auto sels = p2sel[pi];
|
auto sels = p2sel[pi];
|
||||||
Vec<3> new_gw = growthvectors[pi];
|
Vec<3> new_gw = growthvectors[pi];
|
||||||
int cnt = 1;
|
// int cnt = 1;
|
||||||
std::set<PointIndex> suround;
|
std::set<PointIndex> suround;
|
||||||
suround.insert(pi);
|
suround.insert(pi);
|
||||||
auto normal = normals[pi];
|
auto normal = normals[pi];
|
||||||
@ -691,20 +693,22 @@ namespace netgen
|
|||||||
if(face_done.Test(facei))
|
if(face_done.Test(facei))
|
||||||
continue;
|
continue;
|
||||||
bool point_moved = false;
|
bool point_moved = false;
|
||||||
bool point_fixed = false;
|
// bool point_fixed = false;
|
||||||
for(auto pi : sel.PNums())
|
for(auto pi : sel.PNums())
|
||||||
{
|
{
|
||||||
if(growthvectors[pi].Length() > 0)
|
if(growthvectors[pi].Length() > 0)
|
||||||
point_moved = true;
|
point_moved = true;
|
||||||
|
/*
|
||||||
else
|
else
|
||||||
point_fixed = true;
|
point_fixed = true;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
if(point_moved && !moved_surfaces.Test(facei))
|
if(point_moved && !moved_surfaces.Test(facei))
|
||||||
{
|
{
|
||||||
int new_si = mesh.GetNFD()+1;
|
int new_si = mesh.GetNFD()+1;
|
||||||
const auto& fd = mesh.GetFaceDescriptor(facei);
|
const auto& fd = mesh.GetFaceDescriptor(facei);
|
||||||
auto isIn = domains.Test(fd.DomainIn());
|
// auto isIn = domains.Test(fd.DomainIn());
|
||||||
auto isOut = domains.Test(fd.DomainOut());
|
// auto isOut = domains.Test(fd.DomainOut());
|
||||||
int si = params.sides_keep_surfaceindex ? facei : -1;
|
int si = params.sides_keep_surfaceindex ? facei : -1;
|
||||||
// domin and domout can only be set later
|
// domin and domout can only be set later
|
||||||
FaceDescriptor new_fd(si, -1,
|
FaceDescriptor new_fd(si, -1,
|
||||||
@ -1101,7 +1105,7 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
// copy here since we will add segments and this would
|
// copy here since we will add segments and this would
|
||||||
// invalidate a reference!
|
// invalidate a reference!
|
||||||
auto segi = segments[sei];
|
// auto segi = segments[sei];
|
||||||
for(auto [sej, type] : segmap[sei])
|
for(auto [sej, type] : segmap[sei])
|
||||||
{
|
{
|
||||||
auto segj = segments[sej];
|
auto segj = segments[sej];
|
||||||
@ -1473,9 +1477,9 @@ namespace netgen
|
|||||||
points.Append(pi);
|
points.Append(pi);
|
||||||
|
|
||||||
auto p2el = mesh.CreatePoint2ElementTable(is_inner_point);
|
auto p2el = mesh.CreatePoint2ElementTable(is_inner_point);
|
||||||
|
|
||||||
// smooth growth vectors to shift additional element layers to the inside and fix flipped tets
|
// smooth growth vectors to shift additional element layers to the inside and fix flipped tets
|
||||||
for(auto step : Range(10))
|
for([[maybe_unused]] auto step : Range(10))
|
||||||
{
|
{
|
||||||
for(auto pi : points)
|
for(auto pi : points)
|
||||||
{
|
{
|
||||||
|
@ -165,11 +165,12 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto oldnf = mesh.GetNSE();
|
auto oldnf = mesh.GetNSE();
|
||||||
auto res = meshing.GenerateMesh (mesh, mp, mp.maxh, domain);
|
// auto res =
|
||||||
|
meshing.GenerateMesh (mesh, mp, mp.maxh, domain);
|
||||||
for (SurfaceElementIndex sei : Range(oldnf, mesh.GetNSE()))
|
for (SurfaceElementIndex sei : Range(oldnf, mesh.GetNSE()))
|
||||||
mesh[sei].SetIndex (domain);
|
mesh[sei].SetIndex (domain);
|
||||||
|
|
||||||
int hsteps = mp.optsteps2d;
|
// int hsteps = mp.optsteps2d;
|
||||||
|
|
||||||
const char * optstr = mp.optimize2d.c_str();
|
const char * optstr = mp.optimize2d.c_str();
|
||||||
MeshOptimize2d meshopt(mesh);
|
MeshOptimize2d meshopt(mesh);
|
||||||
@ -219,7 +220,7 @@ namespace netgen
|
|||||||
|
|
||||||
int np = mesh.GetNP();
|
int np = mesh.GetNP();
|
||||||
int nseg = line_segments.Size();
|
int nseg = line_segments.Size();
|
||||||
int ne = mesh.GetNSE();
|
// int ne = mesh.GetNSE();
|
||||||
mesh.UpdateTopology();
|
mesh.UpdateTopology();
|
||||||
|
|
||||||
double total_thickness = 0.0;
|
double total_thickness = 0.0;
|
||||||
@ -246,7 +247,7 @@ namespace netgen
|
|||||||
Array<int> si_map(mesh.GetNFD()+2);
|
Array<int> si_map(mesh.GetNFD()+2);
|
||||||
si_map = -1;
|
si_map = -1;
|
||||||
|
|
||||||
int fd_old = mesh.GetNFD();
|
// int fd_old = mesh.GetNFD();
|
||||||
|
|
||||||
int max_edge_nr = -1;
|
int max_edge_nr = -1;
|
||||||
int max_domain = -1;
|
int max_domain = -1;
|
||||||
@ -284,7 +285,8 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
FaceDescriptor new_fd(0, 0, 0, -1);
|
FaceDescriptor new_fd(0, 0, 0, -1);
|
||||||
new_fd.SetBCProperty(new_domain);
|
new_fd.SetBCProperty(new_domain);
|
||||||
int new_fd_index = mesh.AddFaceDescriptor(new_fd);
|
// int new_fd_index =
|
||||||
|
mesh.AddFaceDescriptor(new_fd);
|
||||||
if(should_make_new_domain)
|
if(should_make_new_domain)
|
||||||
mesh.SetBCName(new_domain-1, "mapped_" + mesh.GetBCName(domain-1));
|
mesh.SetBCName(new_domain-1, "mapped_" + mesh.GetBCName(domain-1));
|
||||||
}
|
}
|
||||||
@ -625,7 +627,7 @@ namespace netgen
|
|||||||
auto & pm0 = mapto[seg[0]];
|
auto & pm0 = mapto[seg[0]];
|
||||||
auto & pm1 = mapto[seg[1]];
|
auto & pm1 = mapto[seg[1]];
|
||||||
|
|
||||||
auto newindex = si_map[domain];
|
// auto newindex = si_map[domain];
|
||||||
|
|
||||||
Segment s = seg;
|
Segment s = seg;
|
||||||
s.geominfo[0] = {};
|
s.geominfo[0] = {};
|
||||||
@ -663,7 +665,7 @@ namespace netgen
|
|||||||
auto p0 = mesh[pi0];
|
auto p0 = mesh[pi0];
|
||||||
auto p1 = mesh[pi1];
|
auto p1 = mesh[pi1];
|
||||||
auto q0 = mesh[pi2];
|
auto q0 = mesh[pi2];
|
||||||
auto q1 = mesh[pi3];
|
// auto q1 = mesh[pi3];
|
||||||
|
|
||||||
Vec<2> n = {-p1[1]+p0[1], p1[0]-p0[0]};
|
Vec<2> n = {-p1[1]+p0[1], p1[0]-p0[0]};
|
||||||
Vec<2> v = { q0[0]-p0[0], q0[1]-p0[1]};
|
Vec<2> v = { q0[0]-p0[0], q0[1]-p0[1]};
|
||||||
|
@ -7415,6 +7415,7 @@ namespace netgen
|
|||||||
auto v = pmax-pmin;
|
auto v = pmax-pmin;
|
||||||
double eps = v.Length()*1e-8;
|
double eps = v.Length()*1e-8;
|
||||||
|
|
||||||
|
/*
|
||||||
auto onPlane = [&] (const MeshPoint & p) -> bool
|
auto onPlane = [&] (const MeshPoint & p) -> bool
|
||||||
{
|
{
|
||||||
auto v = p_plane-p;
|
auto v = p_plane-p;
|
||||||
@ -7424,6 +7425,7 @@ namespace netgen
|
|||||||
// auto ret = fabs(v*n_plane)/l;
|
// auto ret = fabs(v*n_plane)/l;
|
||||||
return fabs(v*n_plane) < eps;
|
return fabs(v*n_plane) < eps;
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
auto mirror = [&] (PointIndex pi) -> PointIndex
|
auto mirror = [&] (PointIndex pi) -> PointIndex
|
||||||
|
@ -201,24 +201,24 @@ namespace netgen
|
|||||||
INDEX_4 face4(el[elfaces[j][0]], el[elfaces[j][1]],
|
INDEX_4 face4(el[elfaces[j][0]], el[elfaces[j][1]],
|
||||||
el[elfaces[j][2]], el[elfaces[j][3]]);
|
el[elfaces[j][2]], el[elfaces[j][3]]);
|
||||||
|
|
||||||
int facedir = 0;
|
// int facedir = 0;
|
||||||
if (min2 (face4.I1(), face4.I2()) >
|
if (min2 (face4.I1(), face4.I2()) >
|
||||||
min2 (face4.I4(), face4.I3()))
|
min2 (face4.I4(), face4.I3()))
|
||||||
{ // z - flip
|
{ // z - flip
|
||||||
facedir += 1;
|
// facedir += 1;
|
||||||
swap (face4.I1(), face4.I4());
|
swap (face4.I1(), face4.I4());
|
||||||
swap (face4.I2(), face4.I3());
|
swap (face4.I2(), face4.I3());
|
||||||
}
|
}
|
||||||
if (min2 (face4.I1(), face4.I4()) >
|
if (min2 (face4.I1(), face4.I4()) >
|
||||||
min2 (face4.I2(), face4.I3()))
|
min2 (face4.I2(), face4.I3()))
|
||||||
{ // x - flip
|
{ // x - flip
|
||||||
facedir += 2;
|
// facedir += 2;
|
||||||
swap (face4.I1(), face4.I2());
|
swap (face4.I1(), face4.I2());
|
||||||
swap (face4.I3(), face4.I4());
|
swap (face4.I3(), face4.I4());
|
||||||
}
|
}
|
||||||
if (face4.I2() > face4.I4())
|
if (face4.I2() > face4.I4())
|
||||||
{ // diagonal flip
|
{ // diagonal flip
|
||||||
facedir += 4;
|
// facedir += 4;
|
||||||
swap (face4.I2(), face4.I4());
|
swap (face4.I2(), face4.I4());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,27 +263,27 @@ namespace netgen
|
|||||||
{ // triangle
|
{ // triangle
|
||||||
|
|
||||||
// int facenum;
|
// int facenum;
|
||||||
int facedir;
|
// int facedir;
|
||||||
|
|
||||||
INDEX_4 face(el.PNum(elfaces[0][0]),
|
INDEX_4 face(el.PNum(elfaces[0][0]),
|
||||||
el.PNum(elfaces[0][1]),
|
el.PNum(elfaces[0][1]),
|
||||||
el.PNum(elfaces[0][2]),0);
|
el.PNum(elfaces[0][2]),0);
|
||||||
|
|
||||||
facedir = 0;
|
// facedir = 0;
|
||||||
if (face.I1() > face.I2())
|
if (face.I1() > face.I2())
|
||||||
{
|
{
|
||||||
swap (face.I1(), face.I2());
|
swap (face.I1(), face.I2());
|
||||||
facedir += 1;
|
// facedir += 1;
|
||||||
}
|
}
|
||||||
if (face.I2() > face.I3())
|
if (face.I2() > face.I3())
|
||||||
{
|
{
|
||||||
swap (face.I2(), face.I3());
|
swap (face.I2(), face.I3());
|
||||||
facedir += 2;
|
// facedir += 2;
|
||||||
}
|
}
|
||||||
if (face.I1() > face.I2())
|
if (face.I1() > face.I2())
|
||||||
{
|
{
|
||||||
swap (face.I1(), face.I2());
|
swap (face.I1(), face.I2());
|
||||||
facedir += 4;
|
// facedir += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (face.I1() != v) continue;
|
if (face.I1() != v) continue;
|
||||||
@ -312,31 +312,31 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
// quad
|
// quad
|
||||||
// int facenum;
|
// int facenum;
|
||||||
int facedir;
|
// int facedir;
|
||||||
|
|
||||||
INDEX_4 face4(el.PNum(elfaces[0][0]),
|
INDEX_4 face4(el.PNum(elfaces[0][0]),
|
||||||
el.PNum(elfaces[0][1]),
|
el.PNum(elfaces[0][1]),
|
||||||
el.PNum(elfaces[0][2]),
|
el.PNum(elfaces[0][2]),
|
||||||
el.PNum(elfaces[0][3]));
|
el.PNum(elfaces[0][3]));
|
||||||
|
|
||||||
facedir = 0;
|
// facedir = 0;
|
||||||
if (min2 (face4.I1(), face4.I2()) >
|
if (min2 (face4.I1(), face4.I2()) >
|
||||||
min2 (face4.I4(), face4.I3()))
|
min2 (face4.I4(), face4.I3()))
|
||||||
{ // z - orientation
|
{ // z - orientation
|
||||||
facedir += 1;
|
// facedir += 1;
|
||||||
swap (face4.I1(), face4.I4());
|
swap (face4.I1(), face4.I4());
|
||||||
swap (face4.I2(), face4.I3());
|
swap (face4.I2(), face4.I3());
|
||||||
}
|
}
|
||||||
if (min2 (face4.I1(), face4.I4()) >
|
if (min2 (face4.I1(), face4.I4()) >
|
||||||
min2 (face4.I2(), face4.I3()))
|
min2 (face4.I2(), face4.I3()))
|
||||||
{ // x - orientation
|
{ // x - orientation
|
||||||
facedir += 2;
|
// facedir += 2;
|
||||||
swap (face4.I1(), face4.I2());
|
swap (face4.I1(), face4.I2());
|
||||||
swap (face4.I3(), face4.I4());
|
swap (face4.I3(), face4.I4());
|
||||||
}
|
}
|
||||||
if (face4.I2() > face4.I4())
|
if (face4.I2() > face4.I4())
|
||||||
{
|
{
|
||||||
facedir += 4;
|
// facedir += 4;
|
||||||
swap (face4.I2(), face4.I4());
|
swap (face4.I2(), face4.I4());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ static void EdgesPartition(const TopoDS_Face& F,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean AffichPurge = Standard_False;
|
// Standard_Boolean AffichPurge = Standard_False;
|
||||||
|
|
||||||
if ( LV1.IsEmpty()) return;
|
if ( LV1.IsEmpty()) return;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
static char* name = new char[100];
|
static char* name = new char[100];
|
||||||
static int nbe = 0;
|
// static int nbe = 0;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
@ -198,7 +198,7 @@ static Standard_Boolean SelectEdge(const TopoDS_Face& F,
|
|||||||
Cc->D2(uc, PC, CTg1, CTg2);
|
Cc->D2(uc, PC, CTg1, CTg2);
|
||||||
C->D2(u, P, Tg1, Tg2);
|
C->D2(u, P, Tg1, Tg2);
|
||||||
|
|
||||||
Standard_Real angle;
|
Standard_Real angle = 0.0;
|
||||||
|
|
||||||
if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_FORWARD) {
|
if (CE.Orientation () == TopAbs_REVERSED && E.Orientation () == TopAbs_FORWARD) {
|
||||||
angle = CTg1.Angle(Tg1.Reversed());
|
angle = CTg1.Angle(Tg1.Reversed());
|
||||||
@ -363,7 +363,7 @@ void Partition_Loop::Perform()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
// int i = 0;
|
||||||
while (!End) {
|
while (!End) {
|
||||||
//-------------------------------
|
//-------------------------------
|
||||||
// Construction of a wire.
|
// Construction of a wire.
|
||||||
|
@ -1459,7 +1459,7 @@ void Partition_Spliter::MakeEdges (const TopoDS_Edge& E,
|
|||||||
|
|
||||||
if (VOnE.Extent() < 3) { // do not rebuild not cut edge
|
if (VOnE.Extent() < 3) { // do not rebuild not cut edge
|
||||||
if (( VF.IsSame( VOnE.First() ) && VL.IsSame( VOnE.Last() )) ||
|
if (( VF.IsSame( VOnE.First() ) && VL.IsSame( VOnE.Last() )) ||
|
||||||
VL.IsSame( VOnE.First() ) && VF.IsSame( VOnE.Last() ) ) {
|
(VL.IsSame( VOnE.First() ) && VF.IsSame( VOnE.Last() )) ) {
|
||||||
NE.Append( E );
|
NE.Append( E );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1476,7 +1476,7 @@ void Partition_Spliter::MakeEdges (const TopoDS_Edge& E,
|
|||||||
|
|
||||||
if (SV.Length() < 3) { // do not rebuild not cut edge
|
if (SV.Length() < 3) { // do not rebuild not cut edge
|
||||||
if (( VF.IsSame( SV.First() ) && VL.IsSame( SV.Last() )) ||
|
if (( VF.IsSame( SV.First() ) && VL.IsSame( SV.Last() )) ||
|
||||||
VL.IsSame( SV.First() ) && VF.IsSame( SV.Last() ) ) {
|
( VL.IsSame( SV.First() ) && VF.IsSame( SV.Last() )) ) {
|
||||||
NE.Append( E );
|
NE.Append( E );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1714,11 +1714,13 @@ namespace netgen
|
|||||||
BRepTools::Read(shape, ss, builder);
|
BRepTools::Read(shape, ss, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// enumerate shapes and archive only integers
|
// enumerate shapes and archive only integers
|
||||||
auto my_hash = [](const TopoDS_Shape & key) {
|
auto my_hash = [](const TopoDS_Shape & key) {
|
||||||
auto occ_hash = key.HashCode(1<<31UL);
|
auto occ_hash = key.HashCode(1<<31UL);
|
||||||
return std::hash<decltype(occ_hash)>()(occ_hash);
|
return std::hash<decltype(occ_hash)>()(occ_hash);
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
TopTools_IndexedMapOfShape shape_map;
|
TopTools_IndexedMapOfShape shape_map;
|
||||||
Array<TopoDS_Shape> shape_list;
|
Array<TopoDS_Shape> shape_list;
|
||||||
|
|
||||||
|
@ -1935,7 +1935,7 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m)
|
|||||||
optional<TopoDS_Wire> auxspine) {
|
optional<TopoDS_Wire> auxspine) {
|
||||||
if (twist)
|
if (twist)
|
||||||
{
|
{
|
||||||
auto [pnt, angle] = *twist;
|
// auto [pnt, angle] = *twist;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
cyl = Cylinder((0,0,0), Z, r=1, h=1).faces[0]
|
cyl = Cylinder((0,0,0), Z, r=1, h=1).faces[0]
|
||||||
@ -2230,7 +2230,7 @@ tangents : Dict[int, gp_Vec2d]
|
|||||||
TColgp_Array1OfPnt poles(0, vpoles.size()-1);
|
TColgp_Array1OfPnt poles(0, vpoles.size()-1);
|
||||||
TColStd_Array1OfReal knots(0, vpoles.size()+degree);
|
TColStd_Array1OfReal knots(0, vpoles.size()+degree);
|
||||||
TColStd_Array1OfInteger mult(0, vpoles.size()+degree);
|
TColStd_Array1OfInteger mult(0, vpoles.size()+degree);
|
||||||
int cnt = 0;
|
// int cnt = 0;
|
||||||
|
|
||||||
for (int i = 0; i < vpoles.size(); i++)
|
for (int i = 0; i < vpoles.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -278,7 +278,7 @@ NGCORE_API_EXPORT void ExportSTL(py::module & m)
|
|||||||
throw Exception("Point not found in triangle");
|
throw Exception("Point not found in triangle");
|
||||||
self->SetSelectTrig(trignr);
|
self->SetSelectTrig(trignr);
|
||||||
self->SetNodeOfSelTrig(point_in_trig);
|
self->SetNodeOfSelTrig(point_in_trig);
|
||||||
for(auto i : Range(count))
|
for([[maybe_unused]] auto i : Range(count))
|
||||||
self->MoveSelectedPointToMiddle();
|
self->MoveSelectedPointToMiddle();
|
||||||
})
|
})
|
||||||
.def("Save", &STLGeometry::Save)
|
.def("Save", &STLGeometry::Save)
|
||||||
|
@ -148,13 +148,15 @@ namespace nglib
|
|||||||
numpoints = me->GetNP();
|
numpoints = me->GetNP();
|
||||||
|
|
||||||
// Initially set up only for surface meshing without any optimisation
|
// Initially set up only for surface meshing without any optimisation
|
||||||
int perfstepsend = MESHCONST_MESHSURFACE;
|
// int perfstepsend = MESHCONST_MESHSURFACE;
|
||||||
|
|
||||||
// Check and if required, enable surface mesh optimisation step
|
// Check and if required, enable surface mesh optimisation step
|
||||||
|
/*
|
||||||
if(mp->optsurfmeshenable)
|
if(mp->optsurfmeshenable)
|
||||||
{
|
{
|
||||||
perfstepsend = MESHCONST_OPTSURFACE;
|
perfstepsend = MESHCONST_OPTSURFACE;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
occgeom->MeshSurface(*me, mparam);
|
occgeom->MeshSurface(*me, mparam);
|
||||||
occgeom->OptimizeSurface(*me, mparam);
|
occgeom->OptimizeSurface(*me, mparam);
|
||||||
|
Loading…
Reference in New Issue
Block a user