store 'is_curved' flag in mesh elements

This commit is contained in:
Joachim Schoeberl 2015-06-12 13:45:42 +02:00
parent 906bb230d5
commit 3f0c07ce15
4 changed files with 26 additions and 8 deletions

View File

@ -49,7 +49,8 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<1> (int nr) const
ret.faces.num = 0;
ret.faces.ptr = NULL;
ret.is_curved = mesh->GetCurvedElements().IsSegmentCurved(nr);
// ret.is_curved = mesh->GetCurvedElements().IsSegmentCurved(nr);
ret.is_curved = el.IsCurved();
return ret;
}
@ -100,7 +101,8 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<3> (int nr) const
ret.faces.num = MeshTopology::GetNFaces (el.GetType());
ret.faces.ptr = (T_FACE2*)mesh->GetTopology().GetElementFacesPtr (nr);
ret.is_curved = mesh->GetCurvedElements().IsElementCurved(nr);
// ret.is_curved = mesh->GetCurvedElements().IsElementCurved(nr);
ret.is_curved = el.IsCurved();
return ret;
}

View File

@ -5522,10 +5522,12 @@ namespace netgen
{
GetCurvedElements().BuildCurvedElements (ref, aorder, arational);
for (SegmentIndex seg = 0; seg < GetNSeg(); seg++)
(*this)[seg].SetCurved (GetCurvedElements().IsSegmentCurved (seg));
for (SurfaceElementIndex sei = 0; sei < GetNSE(); sei++)
{
(*this)[sei].SetCurved (GetCurvedElements().IsSurfaceElementCurved (sei));
}
(*this)[sei].SetCurved (GetCurvedElements().IsSurfaceElementCurved (sei));
for (ElementIndex ei = 0; ei < GetNE(); ei++)
(*this)[ei].SetCurved (GetCurvedElements().IsElementCurved (ei));
SetNextMajorTimeStamp();
}

View File

@ -57,6 +57,7 @@ namespace netgen
Segment :: Segment()
: is_curved(false)
{
pnums[0] = -1;
pnums[1] = -1;
@ -90,7 +91,7 @@ namespace netgen
}
Segment::Segment (const Segment & other)
:
:
edgenr(other.edgenr),
singedge_left(other.singedge_left),
singedge_right(other.singedge_right),
@ -104,7 +105,8 @@ namespace netgen
surfnr2(other.surfnr2),
epgeominfo(),
meshdocval(other.meshdocval),
hp_elnr(other.hp_elnr)
hp_elnr(other.hp_elnr),
is_curved(other.is_curved)
{
for (int j = 0; j < 3; j++)
pnums[j] = other.pnums[j];
@ -140,6 +142,7 @@ namespace netgen
meshdocval = other.meshdocval;
hp_elnr = other.hp_elnr;
bcname = other.bcname;
is_curved = other.is_curved;
}
return *this;
@ -948,7 +951,7 @@ namespace netgen
flags.deleted = 0;
flags.fixed = 0;
orderx = ordery = orderz = 1;
is_curved = false;
#ifdef PARALLEL
partitionNumber = -1;
#endif
@ -984,6 +987,7 @@ namespace netgen
default: cerr << "Element::Element: unknown element with " << np << " points" << endl;
}
orderx = ordery = orderz = 1;
is_curved = false;
}
void Element :: SetOrder (const int aorder)
@ -1021,6 +1025,7 @@ namespace netgen
flags.deleted = 0;
flags.fixed = 0;
orderx = ordery = orderz = 1;
is_curved = false;
}
@ -1040,6 +1045,7 @@ namespace netgen
orderz = el2.orderz;
hp_elnr = el2.hp_elnr;
flags = el2.flags;
is_curved = el2.is_curved;
return *this;
}

View File

@ -574,6 +574,7 @@ namespace netgen
unsigned int levelz:6; */
/// stored shape-badness of element
float badness;
bool is_curved:1; // element is (high order) curved
#ifdef PARALLEL
/// number of partition for parallel computation
@ -771,6 +772,8 @@ namespace netgen
return flags.deleted;
}
bool IsCurved () const { return is_curved; }
void SetCurved (bool acurved) { is_curved = acurved; }
#ifdef PARALLEL
@ -842,6 +845,7 @@ namespace netgen
private:
string* bcname;
bool is_curved;
public:
/*
@ -888,6 +892,10 @@ namespace netgen
PointIndex & operator[] (int i) { return pnums[i]; }
const PointIndex & operator[] (int i) const { return pnums[i]; }
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; };