mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
make Element default constructable/movable
This commit is contained in:
parent
7027df2f73
commit
ec20b74722
@ -1663,32 +1663,43 @@ namespace netgen
|
||||
|
||||
|
||||
int MarkHangingTets (T_MTETS & mtets,
|
||||
const INDEX_2_CLOSED_HASHTABLE<PointIndex> & cutedges)
|
||||
const INDEX_2_CLOSED_HASHTABLE<PointIndex> & cutedges,
|
||||
TaskManager tm)
|
||||
{
|
||||
static int timer = NgProfiler::CreateTimer ("MarkHangingTets");
|
||||
NgProfiler::RegionTimer reg (timer);
|
||||
|
||||
int hanging = 0;
|
||||
for (int i = 1; i <= mtets.Size(); i++)
|
||||
{
|
||||
MarkedTet & teti = mtets.Elem(i);
|
||||
// for (int i = 1; i <= mtets.Size(); i++)
|
||||
ParallelForRange
|
||||
(tm, mtets.Size(), [&] (size_t begin, size_t end)
|
||||
{
|
||||
bool my_hanging = false;
|
||||
for (size_t i = begin; i < end; i++)
|
||||
{
|
||||
MarkedTet & teti = mtets[i];
|
||||
|
||||
if (teti.marked)
|
||||
{
|
||||
hanging = 1;
|
||||
continue;
|
||||
}
|
||||
if (teti.marked)
|
||||
{
|
||||
my_hanging = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int j = 0; j < 3; j++)
|
||||
for (int k = j+1; k < 4; k++)
|
||||
{
|
||||
INDEX_2 edge(teti.pnums[j],
|
||||
teti.pnums[k]);
|
||||
edge.Sort();
|
||||
if (cutedges.Used (edge))
|
||||
{
|
||||
teti.marked = 1;
|
||||
hanging = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < 3; j++)
|
||||
for (int k = j+1; k < 4; k++)
|
||||
{
|
||||
INDEX_2 edge(teti.pnums[j],
|
||||
teti.pnums[k]);
|
||||
edge.Sort();
|
||||
if (cutedges.Used (edge))
|
||||
{
|
||||
teti.marked = 1;
|
||||
my_hanging = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (my_hanging) hanging = true;
|
||||
});
|
||||
|
||||
return hanging;
|
||||
}
|
||||
@ -3336,7 +3347,7 @@ namespace netgen
|
||||
|
||||
|
||||
hangingvol =
|
||||
MarkHangingTets (mtets, cutedges) +
|
||||
MarkHangingTets (mtets, cutedges, opt.task_manager) +
|
||||
MarkHangingPrisms (mprisms, cutedges) +
|
||||
MarkHangingIdentifications (mids, cutedges);
|
||||
|
||||
|
@ -926,7 +926,7 @@ namespace netgen
|
||||
PrintMessage (3, n, " volume elements");
|
||||
for (i = 1; i <= n; i++)
|
||||
{
|
||||
Element el;
|
||||
Element el(TET);
|
||||
int hi, nep;
|
||||
infile >> hi;
|
||||
if (hi == 0) hi = 1;
|
||||
@ -1423,7 +1423,7 @@ namespace netgen
|
||||
PrintMessage (3, n, " volume elements");
|
||||
for (i = 1; i <= n; i++)
|
||||
{
|
||||
Element el;
|
||||
Element el(TET);
|
||||
int hi, nep;
|
||||
infile >> hi;
|
||||
if (hi == 0) hi = 1;
|
||||
@ -1960,7 +1960,7 @@ namespace netgen
|
||||
{
|
||||
for (int j = 1; j <= el.GetNFaces(); j++)
|
||||
{
|
||||
Element2d hel;
|
||||
Element2d hel(TRIG);
|
||||
el.GetFace (j, hel);
|
||||
hel.Invert();
|
||||
hel.NormalizeNumbering();
|
||||
|
@ -390,7 +390,7 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
|
||||
delfaces.SetSize (0);
|
||||
|
||||
INDEX npi;
|
||||
Element newel;
|
||||
Element newel(TET);
|
||||
|
||||
npi = mesh.AddPoint (inp);
|
||||
newel.SetNP(4);
|
||||
|
@ -967,7 +967,7 @@ namespace netgen
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Element :: Element ()
|
||||
{
|
||||
typ = TET;
|
||||
@ -990,9 +990,8 @@ namespace netgen
|
||||
#ifdef PARALLEL
|
||||
partitionNumber = -1;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
Element :: Element (int anp)
|
||||
{
|
||||
@ -1061,12 +1060,15 @@ namespace netgen
|
||||
flags.fixed = 0;
|
||||
orderx = ordery = orderz = 1;
|
||||
is_curved = typ != TET; // false;
|
||||
#ifdef PARALLEL
|
||||
partitionNumber = -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Element & Element :: operator= (const Element & el2)
|
||||
{
|
||||
typ = el2.typ;
|
||||
@ -1083,7 +1085,7 @@ namespace netgen
|
||||
is_curved = el2.is_curved;
|
||||
return *this;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
void Element :: SetNP (int anp)
|
||||
|
@ -660,13 +660,18 @@ namespace netgen
|
||||
flagstruct flags;
|
||||
|
||||
///
|
||||
DLL_HEADER Element ();
|
||||
DLL_HEADER Element () = default;
|
||||
Element (const Element &) = default;
|
||||
Element (Element &&) = default;
|
||||
Element & operator= (const Element &) = default;
|
||||
Element & operator= (Element &&) = default;
|
||||
|
||||
///
|
||||
Element (int anp);
|
||||
///
|
||||
Element (ELEMENT_TYPE type);
|
||||
///
|
||||
Element & operator= (const Element & el2);
|
||||
// Element & operator= (const Element & el2);
|
||||
|
||||
///
|
||||
void SetNP (int anp);
|
||||
|
@ -436,7 +436,7 @@ namespace netgen
|
||||
int ind = el.GetIndex();
|
||||
for (int j = 0; j < 8; j++)
|
||||
{
|
||||
Element nel;
|
||||
Element nel(TET);
|
||||
for (int k = 1; k <= 4; k++)
|
||||
nel.PNum(k) = pnums.Get(reftab[j][k-1]);
|
||||
nel.SetIndex(ind);
|
||||
|
@ -204,7 +204,7 @@ namespace netgen
|
||||
const Element & el = mesh.VolumeElement(i);
|
||||
int onp = 0;
|
||||
|
||||
Element newel;
|
||||
Element newel(TET);
|
||||
newel.SetIndex (el.GetIndex());
|
||||
|
||||
static int betw_tet[6][3] =
|
||||
|
Loading…
Reference in New Issue
Block a user