mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 14:10:34 +05:00
PointIndex
This commit is contained in:
parent
0a7a206223
commit
ceddf31f87
@ -473,8 +473,8 @@ namespace netgen
|
||||
{
|
||||
PointGeomInfo gi;
|
||||
gi.trignum = k;
|
||||
meshing.AddBoundaryElement (segments[si][0] + 1 - PointIndex::BASE,
|
||||
segments[si][1] + 1 - PointIndex::BASE,
|
||||
meshing.AddBoundaryElement (segments[si][0] + 1 - IndexBASE<PointIndex>(),
|
||||
segments[si][1] + 1 - IndexBASE<PointIndex>(),
|
||||
gi, gi);
|
||||
}
|
||||
|
||||
|
@ -564,13 +564,17 @@ namespace netgen
|
||||
NgArray<PointIndex> pts ( (nex+1) * (ney+1) ); // x ... inner loop
|
||||
pts = -1;
|
||||
|
||||
for (PointIndex pi = c1, i = 0; pi != c2; pi = nextpi[pi], i++)
|
||||
int i = 0;
|
||||
for (PointIndex pi = c1; pi != c2; pi = nextpi[pi], i++)
|
||||
pts[i] = pi;
|
||||
for (PointIndex pi = c2, i = 0; pi != c3; pi = nextpi[pi], i++)
|
||||
i = 0;
|
||||
for (PointIndex pi = c2; pi != c3; pi = nextpi[pi], i++)
|
||||
pts[(nex+1)*i+nex] = pi;
|
||||
for (PointIndex pi = c3, i = 0; pi != c4; pi = nextpi[pi], i++)
|
||||
i = 0;
|
||||
for (PointIndex pi = c3; pi != c4; pi = nextpi[pi], i++)
|
||||
pts[(nex+1)*(ney+1)-i-1] = pi;
|
||||
for (PointIndex pi = c4, i = 0; pi != c1; pi = nextpi[pi], i++)
|
||||
i = 0;
|
||||
for (PointIndex pi = c4; pi != c1; pi = nextpi[pi], i++)
|
||||
pts[(nex+1)*(ney-i)] = pi;
|
||||
|
||||
|
||||
|
@ -2240,7 +2240,7 @@ int Ng_GetClosureNodes (int nt, int nodenr, int nodeset, int * nodes)
|
||||
for (int i = 0; i < el.GetNP(); i++)
|
||||
{
|
||||
nodes[cnt++] = 0;
|
||||
nodes[cnt++] = el[i] - PointIndex::BASE;
|
||||
nodes[cnt++] = el[i] - IndexBASE<PointIndex>();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2322,7 +2322,7 @@ int Ng_GetElementClosureNodes (int dim, int elementnr, int nodeset, int * nodes)
|
||||
for (int i = 0; i < el.GetNP(); i++)
|
||||
{
|
||||
nodes[cnt++] = 0;
|
||||
nodes[cnt++] = el[i] - PointIndex::BASE;
|
||||
nodes[cnt++] = el[i] - IndexBASE<PointIndex>();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ static void WritePoints ( const Mesh & mesh, ostream & out )
|
||||
out << "*Node" << endl;
|
||||
for(auto pi : mesh.Points().Range() )
|
||||
{
|
||||
out << pi+1-PointIndex::BASE << ", ";
|
||||
out << pi+1-IndexBASE<PointIndex>() << ", ";
|
||||
auto p = mesh[pi];
|
||||
out << p[0] << ", " << p[1] << ", " << p[2] << '\n';
|
||||
}
|
||||
@ -73,7 +73,7 @@ static void WriteElement(ostream & out, const Mesh& mesh, ElIndex ei, const vect
|
||||
auto el = mesh[ei];
|
||||
out << el_counter;
|
||||
for(auto i : Range(el.PNums()))
|
||||
out << ", " << el[permutation[i]]+1-PointIndex::BASE;
|
||||
out << ", " << el[permutation[i]]+1-IndexBASE<PointIndex>();
|
||||
out << '\n';
|
||||
}
|
||||
|
||||
|
@ -502,7 +502,7 @@ namespace netgen
|
||||
<< mesh[i](0) << " "
|
||||
<< mesh[i](1) << " "
|
||||
<< mesh[i](2) << " " << id_type[i] << " ";
|
||||
if(i-PointIndex::BASE < point_ids.Size())
|
||||
if(i-IndexBASE<PointIndex>() < point_ids.Size())
|
||||
outfile << point_ids[i];
|
||||
else
|
||||
outfile << "0";
|
||||
@ -1066,13 +1066,13 @@ namespace netgen
|
||||
// for(PointIndex i = mesh.Points().Begin(); i < mesh.Points().End(); i++)
|
||||
for(PointIndex i : mesh.Points().Range())
|
||||
{
|
||||
if(i-PointIndex::BASE < point_ids.Size())
|
||||
if(i-IndexBASE<PointIndex>() < point_ids.Size())
|
||||
{
|
||||
if(uid_to_group_0D[point_ids[i]] >= 0)
|
||||
groups[uid_to_group_0D[point_ids[i]]]->Append(i+1-PointIndex::BASE);
|
||||
groups[uid_to_group_0D[point_ids[i]]]->Append(i+1-IndexBASE<PointIndex>());
|
||||
}
|
||||
else
|
||||
groups[uid_to_group_0D[0]]->Append(i+1-PointIndex::BASE);
|
||||
groups[uid_to_group_0D[0]]->Append(i+1-IndexBASE<PointIndex>());
|
||||
}
|
||||
|
||||
|
||||
|
@ -584,6 +584,7 @@ namespace netgen
|
||||
|
||||
Array<PointIndex> vert2meshpt(vertices.Size());
|
||||
vert2meshpt = PointIndex::INVALID;
|
||||
|
||||
for(auto & vert : vertices)
|
||||
{
|
||||
auto pi = mesh.AddPoint(vert->GetPoint(), vert->properties.layer);
|
||||
@ -591,9 +592,9 @@ namespace netgen
|
||||
mesh[pi].Singularity(vert->properties.hpref);
|
||||
mesh[pi].SetType(FIXEDPOINT);
|
||||
|
||||
Element0d el(pi, pi);
|
||||
Element0d el(pi, pi-IndexBASE<PointIndex>()+1);
|
||||
el.name = vert->properties.GetName();
|
||||
mesh.SetCD3Name(pi, el.name);
|
||||
mesh.SetCD3Name(pi-IndexBASE<PointIndex>()+1, el.name);
|
||||
mesh.pointelements.Append (el);
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ namespace netgen
|
||||
possible = 1;
|
||||
|
||||
for (int k = 0; k < rel.GetNP(); k++)
|
||||
if (pmap.Elem(rel[k]) != -1 &&
|
||||
if (pmap.Elem(rel[k]).IsValid() &&
|
||||
pmap.Elem(rel[k]) != el.PNumMod (k+elrot[i]+1))
|
||||
possible = 0;
|
||||
|
||||
|
@ -1170,10 +1170,7 @@ double MeshOptimize3d :: SwapImproveEdge (
|
||||
for (int k2 = 0; k2 < 4 && !newpi.IsValid(); k2++)
|
||||
if (nel[k2] == oldpi)
|
||||
{
|
||||
newpi =
|
||||
nel[0] + nel[1] + nel[2] + nel[3]
|
||||
- pi1 - pi2 - oldpi;
|
||||
|
||||
newpi = nel[0] - pi1 + nel[1] - pi2 + nel[2] - oldpi + nel[3];
|
||||
tetused[k] = true;
|
||||
suroundpts[l] = newpi;
|
||||
}
|
||||
@ -1830,7 +1827,7 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
int nsuround = hasbothpoints.Size();
|
||||
int nsuroundother = hasbothpointsother.Size();
|
||||
|
||||
NgArray < int > outerpoints(nsuround+1);
|
||||
NgArray < PointIndex > outerpoints(nsuround+1);
|
||||
outerpoints[0] = sp1;
|
||||
|
||||
for(int i=0; i<nsuround; i++)
|
||||
@ -1865,7 +1862,7 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
{
|
||||
(*testout) << mesh[hasbothpoints[ii]] << endl;
|
||||
for(int jj=0; jj<mesh[hasbothpoints[ii]].GetNP(); jj++)
|
||||
if(mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][0].IsValid())
|
||||
(*testout) << mesh[hasbothpoints[ii]][jj] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][1] << endl;
|
||||
@ -1875,11 +1872,11 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
<< "sel2 " << mesh[sel2] << endl;
|
||||
for(int ii=0; ii<3; ii++)
|
||||
{
|
||||
if(mesh.mlbetweennodes[mesh[sel1][ii]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[sel1][ii]][0].IsValid())
|
||||
(*testout) << mesh[sel1][ii] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[sel1][ii]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[sel1][ii]][1] << endl;
|
||||
if(mesh.mlbetweennodes[mesh[sel2][ii]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[sel2][ii]][0].IsValid())
|
||||
(*testout) << mesh[sel2][ii] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[sel2][ii]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[sel2][ii]][1] << endl;
|
||||
@ -1887,7 +1884,7 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
}
|
||||
|
||||
|
||||
NgArray < int > outerpointsother;
|
||||
NgArray < PointIndex > outerpointsother;
|
||||
|
||||
if(nsuroundother > 0)
|
||||
{
|
||||
@ -1928,7 +1925,7 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
{
|
||||
(*testout) << mesh[hasbothpoints[ii]] << endl;
|
||||
for(int jj=0; jj<mesh[hasbothpoints[ii]].GetNP(); jj++)
|
||||
if(mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][0].IsValid())
|
||||
(*testout) << mesh[hasbothpoints[ii]][jj] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[hasbothpoints[ii]][jj]][1] << endl;
|
||||
@ -1938,11 +1935,11 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
<< "sel2 " << mesh[sel2] << endl;
|
||||
for(int ii=0; ii<3; ii++)
|
||||
{
|
||||
if(mesh.mlbetweennodes[mesh[sel1][ii]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[sel1][ii]][0].IsValid())
|
||||
(*testout) << mesh[sel1][ii] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[sel1][ii]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[sel1][ii]][1] << endl;
|
||||
if(mesh.mlbetweennodes[mesh[sel2][ii]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[sel2][ii]][0].IsValid())
|
||||
(*testout) << mesh[sel2][ii] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[sel2][ii]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[sel2][ii]][1] << endl;
|
||||
@ -1954,7 +1951,7 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
{
|
||||
(*testout) << mesh[hasbothpointsother[ii]] << endl;
|
||||
for(int jj=0; jj<mesh[hasbothpointsother[ii]].GetNP(); jj++)
|
||||
if(mesh.mlbetweennodes[mesh[hasbothpointsother[ii]][jj]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[hasbothpointsother[ii]][jj]][0].IsValid())
|
||||
(*testout) << mesh[hasbothpointsother[ii]][jj] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[hasbothpointsother[ii]][jj]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[hasbothpointsother[ii]][jj]][1] << endl;
|
||||
@ -1964,11 +1961,11 @@ void MeshOptimize3d :: SwapImproveSurface (
|
||||
<< "sel2other " << mesh[sel2other] << endl;
|
||||
for(int ii=0; ii<3; ii++)
|
||||
{
|
||||
if(mesh.mlbetweennodes[mesh[sel1other][ii]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[sel1other][ii]][0].IsValid())
|
||||
(*testout) << mesh[sel1other][ii] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[sel1other][ii]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[sel1other][ii]][1] << endl;
|
||||
if(mesh.mlbetweennodes[mesh[sel2other][ii]][0] > 0)
|
||||
if(mesh.mlbetweennodes[mesh[sel2other][ii]][0].IsValid())
|
||||
(*testout) << mesh[sel2other][ii] << " between "
|
||||
<< mesh.mlbetweennodes[mesh[sel2other][ii]][0] << " and "
|
||||
<< mesh.mlbetweennodes[mesh[sel2other][ii]][1] << endl;
|
||||
|
@ -2867,7 +2867,7 @@ namespace netgen
|
||||
tval i2 = faceht.Get(i3);
|
||||
if (i2.index == el.GetIndex())
|
||||
{
|
||||
i2.index = PointIndex::BASE-1;
|
||||
i2.index = long(PointIndex::BASE)-1;
|
||||
faceht.Set (i3, i2);
|
||||
}
|
||||
else
|
||||
@ -2911,7 +2911,7 @@ namespace netgen
|
||||
faceht.GetData (i, i3, i2);
|
||||
if (i2.index != PointIndex::BASE-1)
|
||||
{
|
||||
Element2d tri ( (i2.p4 == PointIndex::BASE-1) ? TRIG : QUAD);
|
||||
Element2d tri ( (!i2.p4.IsValid()) ? TRIG : QUAD);
|
||||
for (int l = 0; l < 3; l++)
|
||||
tri[l] = i3.I(l+1);
|
||||
tri.PNum(4) = i2.p4;
|
||||
@ -3323,7 +3323,7 @@ namespace netgen
|
||||
*/
|
||||
for (auto & el : VolumeElements())
|
||||
{
|
||||
if (el[0] == -1 || el.IsDeleted()) continue;
|
||||
if (!el[0].IsValid() || el.IsDeleted()) continue;
|
||||
|
||||
int elmin = large;
|
||||
for (int j = 0; j < el.GetNP(); j++)
|
||||
@ -3346,7 +3346,7 @@ namespace netgen
|
||||
*/
|
||||
for (auto & el : VolumeElements())
|
||||
{
|
||||
if (el[0] == -1 || el.IsDeleted()) continue;
|
||||
if (!el[0].IsValid() || el.IsDeleted()) continue;
|
||||
|
||||
int elmin = large;
|
||||
for (int j = 0; j < el.GetNP(); j++)
|
||||
@ -3363,8 +3363,8 @@ namespace netgen
|
||||
PrintMessage (5, "free: ", cntfree, ", fixed: ", GetNE()-cntfree);
|
||||
(*testout) << "free: " << cntfree << ", fixed: " << GetNE()-cntfree << endl;
|
||||
|
||||
for (PointIndex pi = PointIndex::BASE;
|
||||
pi < GetNP()+PointIndex::BASE; pi++)
|
||||
for (PointIndex pi = IndexBASE<PointIndex>();
|
||||
pi < GetNP()+IndexBASE<PointIndex>(); pi++)
|
||||
{
|
||||
if (dist[pi] > layers+1)
|
||||
points[pi].SetType(FIXEDPOINT);
|
||||
@ -3664,18 +3664,16 @@ namespace netgen
|
||||
SetLocalH (pmin, pmax, grading, layer);
|
||||
}
|
||||
|
||||
PointIndex i,j;
|
||||
double hl;
|
||||
// double hl;
|
||||
|
||||
|
||||
for (i = PointIndex::BASE;
|
||||
i < GetNP()+PointIndex::BASE; i++)
|
||||
for (PointIndex i = IndexBASE<PointIndex>();
|
||||
i < GetNP()+IndexBASE<PointIndex>(); i++)
|
||||
{
|
||||
for(j=i+1; j<GetNP()+PointIndex::BASE; j++)
|
||||
for(PointIndex j=i+1; j<GetNP()+IndexBASE<PointIndex>(); j++)
|
||||
{
|
||||
const Point3d & p1 = points[i];
|
||||
const Point3d & p2 = points[j];
|
||||
hl = Dist(p1,p2);
|
||||
double hl = Dist(p1,p2);
|
||||
RestrictLocalH(p1,hl);
|
||||
RestrictLocalH(p2,hl);
|
||||
//cout << "restricted h at " << p1 << " and " << p2 << " to " << hl << endl;
|
||||
@ -3718,7 +3716,7 @@ namespace netgen
|
||||
continue;
|
||||
for (j = 1; j <= 3; j++)
|
||||
{
|
||||
INDEX_2 i2(sel.PNumMod(j), sel.PNumMod(j+1));
|
||||
PointIndices<2> i2(sel.PNumMod(j), sel.PNumMod(j+1));
|
||||
i2.Sort();
|
||||
if (bedges.Used(i2)) continue;
|
||||
|
||||
@ -3728,22 +3726,22 @@ namespace netgen
|
||||
|
||||
const Element2d & elother = SurfaceElement(other);
|
||||
|
||||
int pi3 = 1;
|
||||
while ( (sel.PNum(pi3) == i2.I1()) ||
|
||||
(sel.PNum(pi3) == i2.I2()))
|
||||
pi3++;
|
||||
pi3 = sel.PNum(pi3);
|
||||
int pi3_ = 1;
|
||||
while ( (sel.PNum(pi3_) == i2[0]) ||
|
||||
(sel.PNum(pi3_) == i2[1]))
|
||||
pi3_++;
|
||||
PointIndex pi3 = sel.PNum(pi3_);
|
||||
|
||||
int pi4 = 1;
|
||||
while ( (elother.PNum(pi4) == i2.I1()) ||
|
||||
(elother.PNum(pi4) == i2.I2()))
|
||||
pi4++;
|
||||
pi4 = elother.PNum(pi4);
|
||||
int pi4_ = 1;
|
||||
while ( (elother.PNum(pi4_) == i2[0]) ||
|
||||
(elother.PNum(pi4_) == i2[1]))
|
||||
pi4_++;
|
||||
PointIndex pi4 = elother.PNum(pi4_);
|
||||
|
||||
double rad = ComputeCylinderRadius (Point (PointIndex(i2.I1())),
|
||||
Point (PointIndex(i2.I2())),
|
||||
Point (PointIndex(pi3)),
|
||||
Point (PointIndex(pi4)));
|
||||
double rad = ComputeCylinderRadius (Point (i2[0]),
|
||||
Point (i2[1]),
|
||||
Point (pi3),
|
||||
Point (pi4));
|
||||
|
||||
RestrictLocalHLine (Point(PointIndex(i2.I1())), Point(PointIndex(i2.I2())), rad/elperr);
|
||||
|
||||
@ -6634,7 +6632,7 @@ namespace netgen
|
||||
SurfaceElementIndex si = facedecoding[facenr-1].firstelement;
|
||||
while (si != -1)
|
||||
{
|
||||
if ( (*this)[si].GetIndex () == facenr && (*this)[si][0] >= PointIndex::BASE &&
|
||||
if ( (*this)[si].GetIndex () == facenr && (*this)[si][0].IsValid() &&
|
||||
!(*this)[si].IsDeleted() )
|
||||
{
|
||||
sei.Append (si);
|
||||
|
@ -541,8 +541,8 @@ namespace netgen
|
||||
|
||||
// problem recognition !
|
||||
if (found &&
|
||||
(gpi1 < illegalpoint.Size()+PointIndex::BASE) &&
|
||||
(gpi2 < illegalpoint.Size()+PointIndex::BASE) )
|
||||
(gpi1 < illegalpoint.Size()+IndexBASE<PointIndex>()) &&
|
||||
(gpi2 < illegalpoint.Size()+IndexBASE<PointIndex>()) )
|
||||
{
|
||||
if (illegalpoint[gpi1] || illegalpoint[gpi2])
|
||||
found = 0;
|
||||
|
@ -235,7 +235,7 @@ namespace netgen
|
||||
friend bool operator!= (PointIndex a, PointIndex b);
|
||||
*/
|
||||
public:
|
||||
constexpr PointIndex (t_invalid inv) : i(PointIndex::BASE-1) { ; }
|
||||
constexpr PointIndex (t_invalid inv) : i(long(PointIndex::BASE)-1) { ; }
|
||||
// PointIndex & operator= (const PointIndex &ai) { i = ai.i; return *this; }
|
||||
// private:
|
||||
constexpr operator const int& () const { return i; }
|
||||
@ -246,8 +246,8 @@ namespace netgen
|
||||
PointIndex & operator++ () { i++; return *this; }
|
||||
PointIndex operator-- () { i--; return *this; }
|
||||
PointIndex operator+= (int add) { i += add; return *this; }
|
||||
void Invalidate() { i = PointIndex::BASE-1; }
|
||||
bool IsValid() const { return i != PointIndex::BASE-1; }
|
||||
void Invalidate() { i = long(PointIndex::BASE)-1; }
|
||||
bool IsValid() const { return i+1 != PointIndex::BASE; }
|
||||
// operator bool() const { return IsValid(); }
|
||||
#ifdef BASE0
|
||||
static constexpr size_t BASE = 0;
|
||||
@ -816,7 +816,7 @@ namespace netgen
|
||||
|
||||
void Delete ()
|
||||
{
|
||||
deleted = 1;
|
||||
deleted = true;
|
||||
// for (PointIndex & p : pnum) p.Invalidate();
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,8 @@ namespace netgen
|
||||
local vertex numbers on distant procs
|
||||
(I think this was only used for debugging??)
|
||||
**/
|
||||
for (int vert = 1; vert <= GetNP(); vert++ )
|
||||
// for (int vert = 1; vert <= GetNP(); vert++ )
|
||||
for (PointIndex vert : Points().Range())
|
||||
{
|
||||
NgFlatArray<int> procs = procs_of_vert[vert];
|
||||
for (int j = 0; j < procs.Size(); j++)
|
||||
@ -1017,7 +1018,7 @@ namespace netgen
|
||||
|
||||
for (int vert = 0; vert < numvert; vert++)
|
||||
{
|
||||
int globvert = verts[vert] + IndexBASE<T_POINTS::index_type>();
|
||||
PointIndex globvert = verts[vert] + IndexBASE<T_POINTS::index_type>();
|
||||
// paralleltop->SetLoc2Glob_Vert ( vert+1, globvert );
|
||||
paralleltop->L2G (PointIndex(vert+PointIndex::BASE)) = globvert;
|
||||
glob2loc_vert_ht.Set (globvert, vert+1);
|
||||
|
@ -93,7 +93,7 @@ namespace netgen
|
||||
comm.AllGather (num_master_points, first_master_point);
|
||||
auto max_oldv = comm.AllReduce (Max (glob_vert.Range(0, oldnv)), NG_MPI_MAX);
|
||||
if (comm.AllReduce (oldnv, NG_MPI_SUM) == 0)
|
||||
max_oldv = PointIndex::BASE-1;
|
||||
max_oldv = long(PointIndex::BASE)-1;
|
||||
|
||||
size_t num_glob_points = max_oldv+1;
|
||||
for (int i = 0; i < comm.Size(); i++)
|
||||
|
@ -1561,7 +1561,7 @@ py::arg("point_tolerance") = -1.)
|
||||
{
|
||||
const auto & seg = segs[i];
|
||||
for(auto k : Range(2))
|
||||
output[2*i+k] = seg[k]-PointIndex::BASE;
|
||||
output[2*i+k] = seg[k]-IndexBASE<PointIndex>();
|
||||
} });
|
||||
return output;
|
||||
})
|
||||
@ -1580,8 +1580,8 @@ py::arg("point_tolerance") = -1.)
|
||||
// PointIndex p0,p1;
|
||||
// topo.GetEdgeVertices(i+1, p0, p1);
|
||||
auto [p0,p1] = topo.GetEdgeVertices(i);
|
||||
output[2*i] = p0-PointIndex::BASE;
|
||||
output[2*i+1] = p1-PointIndex::BASE;
|
||||
output[2*i] = p0-IndexBASE<PointIndex>();
|
||||
output[2*i+1] = p1-IndexBASE<PointIndex>();
|
||||
} });
|
||||
return output;
|
||||
})
|
||||
@ -1599,7 +1599,7 @@ py::arg("point_tolerance") = -1.)
|
||||
const auto & sel = surfels[i];
|
||||
auto * trig = &trigs[3*i];
|
||||
for(auto k : Range(3))
|
||||
trig[k] = sel[k]-PointIndex::BASE;
|
||||
trig[k] = sel[k]-IndexBASE<PointIndex>();
|
||||
// todo: quads (store the second trig in thread-local extra array, merge them at the end (mutex)
|
||||
} });
|
||||
return trigs;
|
||||
@ -1617,7 +1617,7 @@ py::arg("point_tolerance") = -1.)
|
||||
const auto & el = els[i];
|
||||
auto * trig = &tets[4*i];
|
||||
for(auto k : Range(4))
|
||||
trig[k] = el[k]-PointIndex::BASE;
|
||||
trig[k] = el[k]-IndexBASE<PointIndex>();
|
||||
// todo: prisms etc (store the extra tets in thread-local extra array, merge them at the end (mutex)
|
||||
} });
|
||||
return tets;
|
||||
|
@ -189,8 +189,8 @@ namespace netgen
|
||||
mesh.Point(pinew) = pnew;
|
||||
// between.Set (i2, pinew);
|
||||
|
||||
if (pinew >= epgi.Size()+PointIndex::BASE)
|
||||
epgi.SetSize (pinew+1-PointIndex::BASE);
|
||||
if (pinew >= epgi.Size()+IndexBASE<PointIndex>())
|
||||
epgi.SetSize (pinew+1-IndexBASE<PointIndex>());
|
||||
epgi[pinew] = ngi;
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ namespace netgen
|
||||
PrintMessage (5, "have 1d elements");
|
||||
|
||||
// refine surface elements
|
||||
NgArray<PointGeomInfo,PointIndex::BASE> surfgi (8*mesh.GetNP());
|
||||
Array<PointGeomInfo,PointIndex> surfgi (8*mesh.GetNP());
|
||||
for (int i = PointIndex::BASE;
|
||||
i < surfgi.Size()+PointIndex::BASE; i++)
|
||||
surfgi[i].trignum = -1;
|
||||
@ -273,9 +273,9 @@ namespace netgen
|
||||
between.Set (i2, pnums.Get(4+j));
|
||||
}
|
||||
*/
|
||||
if (surfgi.Size() < pnums.Elem(4+j))
|
||||
surfgi.SetSize (pnums.Elem(4+j));
|
||||
surfgi.Elem(pnums.Elem(4+j)) = pgis.Elem(4+j);
|
||||
if (surfgi.Size() < pnums.Elem(4+j)-IndexBASE<PointIndex>()+1)
|
||||
surfgi.SetSize (pnums.Elem(4+j)-IndexBASE<PointIndex>()+1);
|
||||
surfgi[pnums.Elem(4+j)] = pgis.Elem(4+j);
|
||||
}
|
||||
|
||||
|
||||
@ -356,9 +356,9 @@ namespace netgen
|
||||
mesh.Point(pinew) = pb;
|
||||
}
|
||||
|
||||
if (surfgi.Size() < pnums[4+j])
|
||||
surfgi.SetSize (pnums[4+j]);
|
||||
surfgi.Elem(pnums[4+j]) = pgis[4+j];
|
||||
if (surfgi.Size() < pnums[4+j]-IndexBASE<PointIndex>()+1)
|
||||
surfgi.SetSize (pnums[4+j]-IndexBASE<PointIndex>()+1);
|
||||
surfgi[pnums[4+j]] = pgis[4+j];
|
||||
}
|
||||
|
||||
static int reftab[4][4] =
|
||||
|
@ -1736,7 +1736,7 @@ void Mesh :: ImproveMeshJacobianOnSurface (const MeshingParameters & mp,
|
||||
{
|
||||
for(int j=0; brother == -1 && j<used_idmaps->Size(); j++)
|
||||
{
|
||||
if(pi < (*used_idmaps)[j]->Size() + PointIndex::BASE)
|
||||
if(pi < (*used_idmaps)[j]->Size() + IndexBASE<PointIndex>())
|
||||
{
|
||||
brother = (*(*used_idmaps)[j])[pi];
|
||||
if(brother == pi || brother == 0)
|
||||
|
@ -969,7 +969,7 @@ namespace netgen
|
||||
{
|
||||
PointIndex v0 = pa[k]; // also in face
|
||||
PointIndex v1 = pa[1-k];
|
||||
PointIndex v2 = f3[0]+f3[1]+f3[2] - v - v0;
|
||||
PointIndex v2 = f3[0]-v+f3[1]-v0+f3[2];
|
||||
// if there is an edge connecting v1 and v2, accept
|
||||
// the new face
|
||||
IVec<2> parentedge(v1, v2);
|
||||
@ -1000,7 +1000,7 @@ namespace netgen
|
||||
{
|
||||
PointIndex v0 = pa[k]; // also in face
|
||||
PointIndex v1 = pa[1-k];
|
||||
PointIndex v2 = f3[0]+f3[1]+f3[2] - v - v0;
|
||||
PointIndex v2 = f3[0]-v+f3[1]-v0+f3[2];
|
||||
// if there is an edge connecting v1 and v2, accept
|
||||
// the new face
|
||||
IVec<2> parentedge(v1, v2);
|
||||
@ -1428,7 +1428,7 @@ namespace netgen
|
||||
PointIndex v1 = parents[1-j];
|
||||
|
||||
// the third one, on the tip
|
||||
PointIndex v2 = f3[0]+f3[1]+f3[2] - v0 - vb;
|
||||
PointIndex v2 = f3[0]-v0+f3[1]-vb+f3[2];
|
||||
|
||||
// if there is an edge connecting v1 and v2, accept
|
||||
// the new face
|
||||
|
@ -209,7 +209,7 @@ namespace netgen
|
||||
if(!isedgepoint.Test(sel.PNum(j)))
|
||||
{
|
||||
isboundarypoint.SetBit(sel.PNum(j));
|
||||
surfaceindex[sel.PNum(j) - PointIndex::BASE] =
|
||||
surfaceindex[sel.PNum(j) - IndexBASE<PointIndex>()] =
|
||||
mesh.GetFaceDescriptor(sel.GetIndex()).SurfNr();
|
||||
}
|
||||
|
||||
@ -259,8 +259,8 @@ namespace netgen
|
||||
if(isnewpoint.Test(i+PointIndex::BASE) &&
|
||||
//working_points.Test(i+PointIndex::BASE) &&
|
||||
mesh.mlbetweennodes[i+PointIndex::BASE][0] > 0)
|
||||
*can[i] = Center(*can[mesh.mlbetweennodes[i+PointIndex::BASE][0]-PointIndex::BASE],
|
||||
*can[mesh.mlbetweennodes[i+PointIndex::BASE][1]-PointIndex::BASE]);
|
||||
*can[i] = Center(*can[mesh.mlbetweennodes[i+PointIndex::BASE][0]-IndexBASE<PointIndex>()],
|
||||
*can[mesh.mlbetweennodes[i+PointIndex::BASE][1]-IndexBASE<PointIndex>()]);
|
||||
else
|
||||
*can[i] = mesh.Point(i+1);
|
||||
}
|
||||
@ -320,7 +320,7 @@ namespace netgen
|
||||
auxvec.Normalize();
|
||||
for (int j = 1; j <= sel.GetNP(); j++)
|
||||
if(!isedgepoint.Test(sel.PNum(j)))
|
||||
*nv[sel.PNum(j) - PointIndex::BASE] += auxvec;
|
||||
*nv[sel.PNum(j) - IndexBASE<PointIndex>()] += auxvec;
|
||||
}
|
||||
for(int i=0; i<nv.Size(); i++)
|
||||
nv[i]->Normalize();
|
||||
|
Loading…
Reference in New Issue
Block a user