mirror of
https://github.com/NGSolve/netgen.git
synced 2025-02-13 13:53:08 +05:00
some index fixes
This commit is contained in:
parent
00edc92c00
commit
00e3a3490b
@ -225,6 +225,12 @@ private:
|
|||||||
bool Test (IndexType i) const { return BitArray::Test(i-IndexBASE<IndexType>()); }
|
bool Test (IndexType i) const { return BitArray::Test(i-IndexBASE<IndexType>()); }
|
||||||
bool operator[] (IndexType i) const { return Test(i); }
|
bool operator[] (IndexType i) const { return Test(i); }
|
||||||
|
|
||||||
|
NGCORE_API TBitArray & Or (const TBitArray & ba2)
|
||||||
|
{
|
||||||
|
BitArray::Or(ba2);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ngcore
|
} // namespace ngcore
|
||||||
|
@ -809,7 +809,7 @@ namespace netgen
|
|||||||
static Timer topenel("Delaunay - find openel"); RegionTimer rt(topenel);
|
static Timer topenel("Delaunay - find openel"); RegionTimer rt(topenel);
|
||||||
|
|
||||||
// find surface triangles which are no face of any tet
|
// find surface triangles which are no face of any tet
|
||||||
TBitArray<PointIndex> bnd_points( mesh.GetNP() + PointIndex::BASE );
|
TBitArray<PointIndex> bnd_points( mesh.GetNP() );
|
||||||
bnd_points.Clear();
|
bnd_points.Clear();
|
||||||
|
|
||||||
for (int i = 1; i <= mesh.GetNOpenElements(); i++)
|
for (int i = 1; i <= mesh.GetNOpenElements(); i++)
|
||||||
@ -891,7 +891,7 @@ namespace netgen
|
|||||||
table.Add(tri[2], openel_i);
|
table.Add(tri[2], openel_i);
|
||||||
}, mesh.GetNP());
|
}, mesh.GetNP());
|
||||||
|
|
||||||
TBitArray<PointIndex> badnode(mesh.GetNP()+PointIndex::BASE);
|
TBitArray<PointIndex> badnode(mesh.GetNP());
|
||||||
badnode.Clear();
|
badnode.Clear();
|
||||||
|
|
||||||
ngcore::ParallelForRange(openels.Size(), [&] (auto myrange) {
|
ngcore::ParallelForRange(openels.Size(), [&] (auto myrange) {
|
||||||
|
@ -7018,7 +7018,7 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Table<ElementIndex, PointIndex> Mesh :: CreatePoint2ElementTable(std::optional<BitArray> points, int domain) const
|
Table<ElementIndex, PointIndex> Mesh :: CreatePoint2ElementTable(std::optional<TBitArray<PointIndex>> points, int domain) const
|
||||||
{
|
{
|
||||||
static Timer timer("Mesh::CreatePoint2VolumeElementTable"); RegionTimer rt(timer);
|
static Timer timer("Mesh::CreatePoint2VolumeElementTable"); RegionTimer rt(timer);
|
||||||
|
|
||||||
|
@ -844,7 +844,7 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
DLL_HEADER Table<ElementIndex, PointIndex> CreatePoint2ElementTable(std::optional<BitArray> points = std::nullopt, int domain = 0) const;
|
DLL_HEADER Table<ElementIndex, PointIndex> CreatePoint2ElementTable(std::optional<TBitArray<PointIndex>> points = std::nullopt, int domain = 0) const;
|
||||||
// DLL_HEADER Table<SurfaceElementIndex, PointIndex> CreatePoint2SurfaceElementTable( int faceindex=0 ) const;
|
// DLL_HEADER Table<SurfaceElementIndex, PointIndex> CreatePoint2SurfaceElementTable( int faceindex=0 ) const;
|
||||||
DLL_HEADER Table<SurfaceElementIndex, PointIndex> CreatePoint2SurfaceElementTable( int faceindex=0 ) const;
|
DLL_HEADER Table<SurfaceElementIndex, PointIndex> CreatePoint2SurfaceElementTable( int faceindex=0 ) const;
|
||||||
DLL_HEADER CompressedTable<SurfaceElementIndex, PointIndex> CreateCompressedPoint2SurfaceElementTable( int faceindex=0 ) const;
|
DLL_HEADER CompressedTable<SurfaceElementIndex, PointIndex> CreateCompressedPoint2SurfaceElementTable( int faceindex=0 ) const;
|
||||||
|
@ -457,14 +457,14 @@ namespace netgen
|
|||||||
|
|
||||||
for (PointIndex pi : mesh.Points().Range())
|
for (PointIndex pi : mesh.Points().Range())
|
||||||
if (domain_bbox.IsIn (mesh[pi]))
|
if (domain_bbox.IsIn (mesh[pi]))
|
||||||
glob2loc[pi] = meshing.AddPoint (mesh[pi], pi);
|
glob2loc[pi] = meshing.AddPoint (mesh[pi], pi);
|
||||||
|
|
||||||
for (auto sel : mesh.OpenElements() )
|
for (auto sel : mesh.OpenElements())
|
||||||
{
|
{
|
||||||
for(auto & pi : sel.PNums())
|
for(auto & pi : sel.PNums())
|
||||||
pi = glob2loc[pi];
|
pi = glob2loc[pi];
|
||||||
meshing.AddBoundaryElement (sel);
|
meshing.AddBoundaryElement (sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
int oldne = mesh.GetNE();
|
int oldne = mesh.GetNE();
|
||||||
|
|
||||||
|
@ -334,23 +334,23 @@ void netrule :: LoadRule (istream & ist)
|
|||||||
{
|
{
|
||||||
elements.Append (Element2d(TRIG));
|
elements.Append (Element2d(TRIG));
|
||||||
|
|
||||||
ist >> elements.Last().PNum(1);
|
ist >> (int&)elements.Last().PNum(1);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
|
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
ist >> elements.Last().PNum(2);
|
ist >> (int&)elements.Last().PNum(2);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
ist >> elements.Last().PNum(3);
|
ist >> (int&)elements.Last().PNum(3);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
elements.Last().SetType (QUAD);
|
elements.Last().SetType (QUAD);
|
||||||
ist >> elements.Last().PNum(4);
|
ist >> (int&)elements.Last().PNum(4);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
|
|
||||||
// const Element2d & el = elements.Last();
|
// const Element2d & el = elements.Last();
|
||||||
|
@ -177,16 +177,16 @@ void vnetrule :: LoadRule (istream & ist)
|
|||||||
while (ch == '(')
|
while (ch == '(')
|
||||||
{
|
{
|
||||||
face.SetType(TRIG);
|
face.SetType(TRIG);
|
||||||
ist >> face.PNum(1);
|
ist >> (int&)face.PNum(1);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
ist >> face.PNum(2);
|
ist >> (int&)face.PNum(2);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
ist >> face.PNum(3);
|
ist >> (int&)face.PNum(3);
|
||||||
ist >> ch; // ')' or ','
|
ist >> ch; // ')' or ','
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
face.SetType(QUAD);
|
face.SetType(QUAD);
|
||||||
ist >> face.PNum(4);
|
ist >> (int&)face.PNum(4);
|
||||||
ist >> ch; // ')'
|
ist >> ch; // ')'
|
||||||
}
|
}
|
||||||
faces.Append (face);
|
faces.Append (face);
|
||||||
@ -285,16 +285,16 @@ void vnetrule :: LoadRule (istream & ist)
|
|||||||
while (ch == '(')
|
while (ch == '(')
|
||||||
{
|
{
|
||||||
face.SetType(TRIG);
|
face.SetType(TRIG);
|
||||||
ist >> face.PNum(1);
|
ist >> (int&)face.PNum(1);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
ist >> face.PNum(2);
|
ist >> (int&)face.PNum(2);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
ist >> face.PNum(3);
|
ist >> (int&)face.PNum(3);
|
||||||
ist >> ch; // ')' or ','
|
ist >> ch; // ')' or ','
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
face.SetType(QUAD);
|
face.SetType(QUAD);
|
||||||
ist >> face.PNum(4);
|
ist >> (int&)face.PNum(4);
|
||||||
ist >> ch; // ')'
|
ist >> ch; // ')'
|
||||||
}
|
}
|
||||||
faces.Append (face);
|
faces.Append (face);
|
||||||
@ -494,40 +494,40 @@ void vnetrule :: LoadRule (istream & ist)
|
|||||||
elements.Append (Element(TET));
|
elements.Append (Element(TET));
|
||||||
|
|
||||||
// elements.Last().SetNP(1);
|
// elements.Last().SetNP(1);
|
||||||
ist >> elements.Last().PNum(1);
|
ist >> (int&)elements.Last().PNum(1);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
|
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
// elements.Last().SetNP(2);
|
// elements.Last().SetNP(2);
|
||||||
ist >> elements.Last().PNum(2);
|
ist >> (int&)elements.Last().PNum(2);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
// elements.Last().SetNP(3);
|
// elements.Last().SetNP(3);
|
||||||
ist >> elements.Last().PNum(3);
|
ist >> (int&)elements.Last().PNum(3);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
// elements.Last().SetNP(4);
|
// elements.Last().SetNP(4);
|
||||||
elements.Last().SetType(TET);
|
elements.Last().SetType(TET);
|
||||||
ist >> elements.Last().PNum(4);
|
ist >> (int&)elements.Last().PNum(4);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
// elements.Last().SetNP(5);
|
// elements.Last().SetNP(5);
|
||||||
elements.Last().SetType(PYRAMID);
|
elements.Last().SetType(PYRAMID);
|
||||||
ist >> elements.Last().PNum(5);
|
ist >> (int&)elements.Last().PNum(5);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
// elements.Last().SetNP(6);
|
// elements.Last().SetNP(6);
|
||||||
elements.Last().SetType(PRISM);
|
elements.Last().SetType(PRISM);
|
||||||
ist >> elements.Last().PNum(6);
|
ist >> (int&)elements.Last().PNum(6);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -535,14 +535,14 @@ void vnetrule :: LoadRule (istream & ist)
|
|||||||
{
|
{
|
||||||
// elements.Last().SetNP(6);
|
// elements.Last().SetNP(6);
|
||||||
elements.Last().SetType(HEX);
|
elements.Last().SetType(HEX);
|
||||||
ist >> elements.Last().PNum(7);
|
ist >> (int&)elements.Last().PNum(7);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
if (ch == COMMASIGN)
|
if (ch == COMMASIGN)
|
||||||
{
|
{
|
||||||
// elements.Last().SetNP(6);
|
// elements.Last().SetNP(6);
|
||||||
elements.Last().SetType(HEX);
|
elements.Last().SetType(HEX);
|
||||||
ist >> elements.Last().PNum(8);
|
ist >> (int&)elements.Last().PNum(8);
|
||||||
ist >> ch; // ','
|
ist >> ch; // ','
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ namespace netgen
|
|||||||
if (mesh.mlbetweennodes.Size() < mesh.GetNV())
|
if (mesh.mlbetweennodes.Size() < mesh.GetNV())
|
||||||
{
|
{
|
||||||
mesh.mlbetweennodes.SetSize(mesh.GetNV());
|
mesh.mlbetweennodes.SetSize(mesh.GetNV());
|
||||||
mesh.mlbetweennodes = INDEX_2(PointIndex::BASE-1,PointIndex::BASE-1);
|
mesh.mlbetweennodes = PointIndices<2>(PointIndex::INVALID, PointIndex::INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mesh.level_nv.Size() == 0)
|
if (mesh.level_nv.Size() == 0)
|
||||||
|
@ -662,7 +662,7 @@ int Meshing3 :: ApplyRules
|
|||||||
// for (int i = 1; i <= lpoints.Size(); i++)
|
// for (int i = 1; i <= lpoints.Size(); i++)
|
||||||
for (auto i : lpoints.Range())
|
for (auto i : lpoints.Range())
|
||||||
{
|
{
|
||||||
if ( !pused.Get(i) )
|
if ( !pused[i] )
|
||||||
{
|
{
|
||||||
const Point3d & lp = lpoints[i];
|
const Point3d & lp = lpoints[i];
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ namespace netgen
|
|||||||
{ } ;
|
{ } ;
|
||||||
|
|
||||||
|
|
||||||
virtual double Func (const Vector & x) const
|
virtual double Func (const Vector & x) const override
|
||||||
{
|
{
|
||||||
double badness = 0;
|
double badness = 0;
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual double FuncGrad (const Vector & x, Vector & g) const
|
virtual double FuncGrad (const Vector & x, Vector & g) const override
|
||||||
{
|
{
|
||||||
Vec<3> vgrad;
|
Vec<3> vgrad;
|
||||||
Point<3> pp1;
|
Point<3> pp1;
|
||||||
@ -278,7 +278,7 @@ namespace netgen
|
|||||||
return badness;
|
return badness;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual double FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const
|
virtual double FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const override
|
||||||
{
|
{
|
||||||
deriv = 0;
|
deriv = 0;
|
||||||
double badness = 0;
|
double badness = 0;
|
||||||
@ -479,8 +479,8 @@ namespace netgen
|
|||||||
Opti2dLocalData & ald)
|
Opti2dLocalData & ald)
|
||||||
: mesh(amesh), ld(ald), geo(*amesh.GetGeometry()) { } ;
|
: mesh(amesh), ld(ald), geo(*amesh.GetGeometry()) { } ;
|
||||||
|
|
||||||
virtual double FuncGrad (const Vector & x, Vector & g) const;
|
virtual double FuncGrad (const Vector & x, Vector & g) const override;
|
||||||
virtual double Func (const Vector & x) const;
|
virtual double Func (const Vector & x) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
double Opti2EdgeMinFunction :: Func (const Vector & x) const
|
double Opti2EdgeMinFunction :: Func (const Vector & x) const
|
||||||
@ -550,9 +550,9 @@ namespace netgen
|
|||||||
Opti2dLocalData & ald)
|
Opti2dLocalData & ald)
|
||||||
: mesh(amesh), ld(ald), geo(*amesh.GetGeometry())
|
: mesh(amesh), ld(ald), geo(*amesh.GetGeometry())
|
||||||
{ } ;
|
{ } ;
|
||||||
virtual double FuncGrad (const Vector & x, Vector & g) const;
|
virtual double FuncGrad (const Vector & x, Vector & g) const override;
|
||||||
virtual double FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const;
|
virtual double FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const override;
|
||||||
virtual double Func (const Vector & x) const;
|
virtual double Func (const Vector & x) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
double Opti2SurfaceMinFunctionJacobian ::
|
double Opti2SurfaceMinFunctionJacobian ::
|
||||||
|
Loading…
Reference in New Issue
Block a user