mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-24 20:00:33 +05:00
Merge branch 'attach_marked_els_to_mesh' into 'master'
marked elements now in BisectionInfo member of meshclass instead of global See merge request ngsolve/netgen!606
This commit is contained in:
commit
3c33c7c07a
@ -8,20 +8,6 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
class MarkedTet;
|
||||
class MarkedPrism;
|
||||
class MarkedIdentification;
|
||||
class MarkedTri;
|
||||
class MarkedQuad;
|
||||
|
||||
typedef Array<MarkedTet> T_MTETS;
|
||||
typedef NgArray<MarkedPrism> T_MPRISMS;
|
||||
typedef NgArray<MarkedIdentification> T_MIDS;
|
||||
typedef NgArray<MarkedTri> T_MTRIS;
|
||||
typedef NgArray<MarkedQuad> T_MQUADS;
|
||||
|
||||
|
||||
|
||||
class MarkedTet
|
||||
{
|
||||
public:
|
||||
@ -1867,20 +1853,25 @@ namespace netgen
|
||||
}
|
||||
}
|
||||
|
||||
BisectionInfo::BisectionInfo()
|
||||
{
|
||||
mtets = make_unique<T_MTETS>();
|
||||
mprisms = make_unique<T_MPRISMS>();
|
||||
mids = make_unique<T_MIDS>();
|
||||
mtris = make_unique<T_MTRIS>();
|
||||
mquads = make_unique<T_MQUADS>();
|
||||
}
|
||||
|
||||
BisectionInfo::~BisectionInfo() {}
|
||||
|
||||
|
||||
T_MTETS mtets;
|
||||
T_MPRISMS mprisms;
|
||||
T_MIDS mids;
|
||||
T_MTRIS mtris;
|
||||
T_MQUADS mquads;
|
||||
|
||||
|
||||
void WriteMarkedElements(ostream & ost)
|
||||
void WriteMarkedElements(const Mesh& mesh, ostream & ost)
|
||||
{
|
||||
ost << "Marked Elements\n";
|
||||
|
||||
const auto& mtets = *mesh.bisectioninfo.mtets;
|
||||
const auto& mprisms = *mesh.bisectioninfo.mprisms;
|
||||
const auto& mids = *mesh.bisectioninfo.mids;
|
||||
const auto& mtris = *mesh.bisectioninfo.mtris;
|
||||
const auto& mquads = *mesh.bisectioninfo.mquads;
|
||||
ost << mtets.Size() << "\n";
|
||||
for(int i=0; i<mtets.Size(); i++)
|
||||
ost << mtets[i];
|
||||
@ -1905,6 +1896,12 @@ namespace netgen
|
||||
|
||||
bool ReadMarkedElements(istream & ist, const Mesh & mesh)
|
||||
{
|
||||
auto& mtets = *mesh.bisectioninfo.mtets;
|
||||
auto& mprisms = *mesh.bisectioninfo.mprisms;
|
||||
auto& mids = *mesh.bisectioninfo.mids;
|
||||
auto& mtris = *mesh.bisectioninfo.mtris;
|
||||
auto& mquads = *mesh.bisectioninfo.mquads;
|
||||
|
||||
string auxstring("");
|
||||
if(ist)
|
||||
ist >> auxstring;
|
||||
@ -1964,6 +1961,11 @@ namespace netgen
|
||||
const NgArray< NgArray<int,PointIndex::BASE>* > & idmaps,
|
||||
const string & refinfofile)
|
||||
{
|
||||
auto& mtets = *mesh.bisectioninfo.mtets;
|
||||
auto& mprisms = *mesh.bisectioninfo.mprisms;
|
||||
auto& mids = *mesh.bisectioninfo.mids;
|
||||
auto& mtris = *mesh.bisectioninfo.mtris;
|
||||
auto& mquads = *mesh.bisectioninfo.mquads;
|
||||
if (mesh.GetDimension() < 2)
|
||||
throw Exception ("Mesh bisection is available in 2D and 3D");
|
||||
// mtets.SetName ("bisection, tets");
|
||||
@ -2475,6 +2477,13 @@ namespace netgen
|
||||
T_MTRIS mtris_old; mtris_old.Copy(mtris);
|
||||
T_MQUADS mquads_old; mquads_old.Copy(mquads);
|
||||
*/
|
||||
|
||||
auto& mtets = *mesh.bisectioninfo.mtets;
|
||||
auto& mprisms = *mesh.bisectioninfo.mprisms;
|
||||
auto& mids = *mesh.bisectioninfo.mids;
|
||||
auto& mtris = *mesh.bisectioninfo.mtris;
|
||||
auto& mquads = *mesh.bisectioninfo.mquads;
|
||||
|
||||
T_MTETS mtets_old (mtets);
|
||||
T_MPRISMS mprisms_old (mprisms);
|
||||
T_MIDS mids_old (mids);
|
||||
@ -2700,6 +2709,12 @@ namespace netgen
|
||||
PrintMessage(1,"Mesh bisection");
|
||||
PushStatus("Mesh bisection");
|
||||
|
||||
auto& mtets = *mesh.bisectioninfo.mtets;
|
||||
auto& mprisms = *mesh.bisectioninfo.mprisms;
|
||||
auto& mids = *mesh.bisectioninfo.mids;
|
||||
auto& mtris = *mesh.bisectioninfo.mtris;
|
||||
auto& mquads = *mesh.bisectioninfo.mquads;
|
||||
|
||||
static int timer = NgProfiler::CreateTimer ("Bisect");
|
||||
static int timer1 = NgProfiler::CreateTimer ("Bisect 1");
|
||||
static int timer1a = NgProfiler::CreateTimer ("Bisect 1a");
|
||||
@ -4104,7 +4119,7 @@ namespace netgen
|
||||
PrintMessage(3,"writing marked-elements information to \"",refelementinfofilewrite,"\"");
|
||||
ofstream ofst(refelementinfofilewrite.c_str());
|
||||
|
||||
WriteMarkedElements(ofst);
|
||||
WriteMarkedElements(mesh, ofst);
|
||||
|
||||
ofst.close();
|
||||
}
|
||||
|
@ -36,6 +36,30 @@ namespace netgen
|
||||
class AnisotropicClusters;
|
||||
class ParallelMeshTopology;
|
||||
|
||||
class MarkedTet;
|
||||
class MarkedPrism;
|
||||
class MarkedIdentification;
|
||||
class MarkedTri;
|
||||
class MarkedQuad;
|
||||
|
||||
typedef Array<MarkedTet> T_MTETS;
|
||||
typedef NgArray<MarkedPrism> T_MPRISMS;
|
||||
typedef NgArray<MarkedIdentification> T_MIDS;
|
||||
typedef NgArray<MarkedTri> T_MTRIS;
|
||||
typedef NgArray<MarkedQuad> T_MQUADS;
|
||||
|
||||
struct BisectionInfo
|
||||
{
|
||||
unique_ptr<T_MTETS> mtets;
|
||||
unique_ptr<T_MPRISMS> mprisms;
|
||||
unique_ptr<T_MIDS> mids;
|
||||
unique_ptr<T_MTRIS> mtris;
|
||||
unique_ptr<T_MQUADS> mquads;
|
||||
|
||||
BisectionInfo();
|
||||
~BisectionInfo();
|
||||
};
|
||||
|
||||
/// 2d/3d mesh
|
||||
class Mesh
|
||||
{
|
||||
@ -186,6 +210,7 @@ namespace netgen
|
||||
|
||||
public:
|
||||
Signal<> updateSignal;
|
||||
BisectionInfo bisectioninfo;
|
||||
|
||||
// store coarse mesh before hp-refinement
|
||||
unique_ptr<NgArray<HPRefElement>> hpelements;
|
||||
|
Loading…
Reference in New Issue
Block a user