mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
little polish
This commit is contained in:
parent
1eca091fd3
commit
478aaf7788
@ -428,10 +428,6 @@ namespace netgen
|
||||
unsigned int orderx:6;
|
||||
unsigned int ordery:6;
|
||||
|
||||
// #ifdef PARALLEL
|
||||
// int partitionNumber;
|
||||
// #endif
|
||||
|
||||
/// a linked list for all segments in the same face
|
||||
SurfaceElementIndex next;
|
||||
|
||||
@ -687,13 +683,6 @@ namespace netgen
|
||||
int meshdocval;
|
||||
///
|
||||
int hp_elnr;
|
||||
|
||||
/*
|
||||
#ifdef PARALLEL
|
||||
int GetPartition () const { return partitionNumber; }
|
||||
void SetPartition (int nr) { partitionNumber = nr; };
|
||||
#endif
|
||||
*/
|
||||
};
|
||||
|
||||
ostream & operator<<(ostream & s, const Element2d & el);
|
||||
@ -758,12 +747,6 @@ namespace netgen
|
||||
float badness;
|
||||
bool is_curved:1; // element is (high order) curved
|
||||
|
||||
// #ifdef PARALLEL
|
||||
/// number of partition for parallel computation
|
||||
// int partitionNumber;
|
||||
|
||||
// #endif
|
||||
|
||||
public:
|
||||
flagstruct flags;
|
||||
|
||||
@ -1010,15 +993,6 @@ namespace netgen
|
||||
bool IsCurved () const { return is_curved; }
|
||||
void SetCurved (bool acurved) { is_curved = acurved; }
|
||||
|
||||
/*
|
||||
#ifdef PARALLEL
|
||||
int GetPartition () const { return partitionNumber; }
|
||||
void SetPartition (int nr) { partitionNumber = nr; };
|
||||
#else
|
||||
int GetPartition () const { return 0; }
|
||||
#endif
|
||||
*/
|
||||
|
||||
int hp_elnr;
|
||||
};
|
||||
|
||||
@ -1076,11 +1050,6 @@ namespace netgen
|
||||
///
|
||||
int meshdocval;
|
||||
|
||||
// #ifdef PARALLEL
|
||||
/// number of partition for parallel computation
|
||||
// int partitionNumber;
|
||||
// #endif
|
||||
|
||||
private:
|
||||
bool is_curved;
|
||||
|
||||
@ -1119,15 +1088,6 @@ namespace netgen
|
||||
bool IsCurved () const { return is_curved; }
|
||||
void SetCurved (bool acurved) { is_curved = acurved; }
|
||||
|
||||
/*
|
||||
#ifdef PARALLEL
|
||||
int GetPartition () const { return partitionNumber; }
|
||||
void SetPartition (int nr) { partitionNumber = nr; };
|
||||
#else
|
||||
int GetPartition () const { return 0; }
|
||||
#endif
|
||||
*/
|
||||
|
||||
void DoArchive (Archive & ar);
|
||||
#ifdef PARALLEL
|
||||
static MPI_Datatype MyGetMPIType();
|
||||
|
@ -316,29 +316,17 @@ namespace netgen
|
||||
double eps = 1e-6 * geom.GetBoundingBox().Diam();
|
||||
|
||||
tsearch.Start();
|
||||
for (int i = 1; i <= nvertices; i++)
|
||||
for (auto [i,vshape] : Enumerate(geom.vmap))
|
||||
{
|
||||
gp_Pnt pnt = BRep_Tool::Pnt (TopoDS::Vertex(geom.vmap(i)));
|
||||
double hpref = OCCGeometry::global_shape_properties[TopoDS::Vertex(geom.vmap(i)).TShape()].hpref;
|
||||
MeshPoint mp(occ2ng(pnt));
|
||||
// mp.Singularity(hpref);
|
||||
TopoDS_Vertex vertex = TopoDS::Vertex(vshape);
|
||||
gp_Pnt pnt = BRep_Tool::Pnt (vertex);
|
||||
|
||||
bool exists = false;
|
||||
if (merge_solids)
|
||||
for (PointIndex pi : mesh.Points().Range())
|
||||
if (Dist2 (mesh[pi], Point<3>(mp)) < eps*eps)
|
||||
{
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
mesh.AddPoint (occ2ng(pnt));
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
mesh.AddPoint (mp);
|
||||
mesh.Points().Last().Singularity(hpref);
|
||||
}
|
||||
double hpref = OCCGeometry::global_shape_properties[vertex.TShape()].hpref;
|
||||
mesh.Points().Last().Singularity(hpref);
|
||||
|
||||
double maxh = OCCGeometry::global_shape_properties[TopoDS::Vertex(geom.vmap(i)).TShape()].maxh;
|
||||
double maxh = OCCGeometry::global_shape_properties[vertex.TShape()].maxh;
|
||||
mesh.RestrictLocalH (occ2ng(pnt), maxh);
|
||||
}
|
||||
tsearch.Stop();
|
||||
@ -356,6 +344,7 @@ namespace netgen
|
||||
face2solid[i] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
int solidnr = 0;
|
||||
for (TopExp_Explorer exp0(geom.shape, TopAbs_SOLID); exp0.More(); exp0.Next())
|
||||
{
|
||||
@ -372,6 +361,22 @@ namespace netgen
|
||||
face2solid[1][facenr-1] = solidnr;
|
||||
}
|
||||
}
|
||||
*/
|
||||
int solidnr = 0;
|
||||
for (auto solid : Explore(geom.shape, TopAbs_SOLID))
|
||||
{
|
||||
solidnr++;
|
||||
for (auto face : Explore (solid, TopAbs_FACE))
|
||||
if (geom.fmap.Contains(face))
|
||||
{
|
||||
int facenr = geom.fmap.FindIndex(face);
|
||||
if (face2solid[0][facenr-1] == 0)
|
||||
face2solid[0][facenr-1] = solidnr;
|
||||
else
|
||||
face2solid[1][facenr-1] = solidnr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1045,11 +1045,15 @@ namespace netgen
|
||||
}
|
||||
|
||||
eprops.SetSize(emap.Extent());
|
||||
/*
|
||||
for (TopExp_Explorer e(shape, TopAbs_EDGE); e.More(); e.Next())
|
||||
{
|
||||
auto s = e.Current();
|
||||
eprops[emap.FindIndex(s)-1] = &global_shape_properties[s.TShape()];
|
||||
}
|
||||
*/
|
||||
for (auto [nr,s] : Enumerate(emap))
|
||||
eprops[nr-1] = &global_shape_properties[s.TShape()];
|
||||
}
|
||||
|
||||
|
||||
|
@ -313,6 +313,8 @@ namespace netgen
|
||||
TopTools_IndexedMapOfShape fmap, emap, vmap, somap, shmap, wmap;
|
||||
NgArray<bool> fsingular, esingular, vsingular;
|
||||
Box<3> boundingbox;
|
||||
|
||||
// should we use 1-based arrays (JS->MH) ?
|
||||
Array<ShapeProperties*> fprops, eprops, sprops; // pointers to the gobal property map
|
||||
|
||||
mutable int changed;
|
||||
|
Loading…
Reference in New Issue
Block a user