Commit f705accc by Christophe Geuzaine

remove unused stuff

parent 93677b55
Pipeline #759 failed with stage
in 16 minutes 35 seconds
......@@ -218,7 +218,7 @@ class GEdge : public GEntity {
virtual void discretize(double tol, std::vector<SPoint3> &dpts, std::vector<double> &ts);
SPoint3 closestPoint (SPoint3 &p, double tolerance);
virtual void mesh(bool) ;
virtual void mesh(bool verbose) ;
};
#endif
......@@ -1344,13 +1344,13 @@ bool GFace::fillPointCloud(double maxDist,
#if defined(HAVE_MESH)
static void meshCompound(GFace* gf, bool verbose)
{
discreteFace *df = new discreteFace (gf->model(), gf->tag() + 100000);
discreteFace *df = new discreteFace(gf->model(), gf->tag() + 100000, true);
std::set<int> ec;
for (unsigned int i=0;i<gf->_compound.size();i++){
for (unsigned int i = 0; i < gf->_compound.size(); i++){
GFace *c = (GFace*)gf->_compound[i];
std::list<GEdge*> edges = c->edges();
for (std::list<GEdge*> :: iterator it = edges.begin() ; it != edges.end(); ++it){
for (std::list<GEdge*>::iterator it = edges.begin() ; it != edges.end(); ++it){
std::set<int>::iterator found = ec.find((*it)->tag());
if (found == ec.end())ec.insert((*it)->tag());
else ec.erase(found);
......@@ -1359,10 +1359,12 @@ static void meshCompound(GFace* gf, bool verbose)
c->triangles.end());
df->mesh_vertices.insert(df->mesh_vertices.end(), c->mesh_vertices.begin(),
c->mesh_vertices.end());
for (unsigned int j=0;j<c->triangles.size();j++)df->_CAD.push_back(c);
for (unsigned int j = 0; j < c->triangles.size(); j++)
df->_CAD.push_back(c);
c->triangles.clear();
c->mesh_vertices.clear();
}
std::vector<int> cedges;
cedges.insert(cedges.begin(), ec.begin(), ec.end());
df->setBoundEdges(cedges);
......@@ -1377,15 +1379,17 @@ void GFace::mesh(bool verbose)
#if defined(HAVE_MESH)
meshGFace mesher;
mesher(this, verbose);
if (!_compound.empty()){ // Some faces are meshed together
if (_compound[0] == this){ // I'm the one that makes the compound job
if(_compound.size()){ // Some faces are meshed together
if(_compound[0] == this){ // I'm the one that makes the compound job
bool ok = true;
for (unsigned int i = 0; i < _compound.size(); i++){
for(unsigned int i = 0; i < _compound.size(); i++){
GFace *gf = (GFace*)_compound[i];
ok &= (gf->meshStatistics.status == GFace::DONE);
}
if (!ok)meshStatistics.status = GFace::PENDING;
else {
if(!ok){
meshStatistics.status = GFace::PENDING;
}
else{
meshCompound(this, verbose);
return;
}
......@@ -1399,8 +1403,8 @@ void GFace::lloyd(int nbiter, int infn)
#if defined(HAVE_MESH) && defined(HAVE_BFGS)
smoothing s = smoothing(nbiter,infn);
s.optimize_face(this);
//lloydAlgorithm algo(nbiter, infn);
//algo(this);
// lloydAlgorithm algo(nbiter, infn);
// algo(this);
#endif
}
......
......@@ -440,9 +440,7 @@ class GModel {
// create topology from mesh
void createTopologyFromMeshNew();
void createTopologyFromMesh(int ignoreHoles=0);
void createTopologyFromRegions(std::vector<discreteRegion*> &discRegions);
void createTopologyFromFaces(std::vector<discreteFace*> &pFaces, int ignoreHoles=0);
void createTopologyFromMesh();
void makeDiscreteRegionsSimplyConnected();
void makeDiscreteFacesSimplyConnected();
......
......@@ -693,7 +693,6 @@ int GModel::_readMSH2(const std::string &name)
_createGeometryOfDiscreteEntities() ;
// copying periodic information from the mesh
rewind(fp);
......
......@@ -32,20 +32,20 @@ class discreteEdge : public GEdge {
virtual Range<double> parBounds(int) const;
bool getLocalParameter(const double &t, int &iEdge, double &tLoc) const;
void interpolateInGeometry (MVertex *v, MVertex **v1, MVertex **v2, double &xi) const;
void interpolateInGeometry (MVertex *v, MVertex **v1, MVertex **v2, double &xi) const;
void parametrize(std::map<GFace*, std::map<MVertex*, MVertex*,
std::less<MVertex*> > > &face2Verts,
std::map<GRegion*, std::map<MVertex*, MVertex*,
std::less<MVertex*> > > &region2Vert);
void parametrize(std::map<MVertex*,MVertex*>& old2New);
void orderMLines();
void setBoundVertices();
void setTopo(std::vector<MLine*>);
void createTopo();
void createGeometry();
void computeNormals () const;
virtual void mesh(bool) ;
virtual void mesh(bool verbose) ;
void writeGEO(FILE *fp);
int minimumDrawSegments() const {return 2*_pars.size();}
MVertex * getGeometricalVertex (MVertex *v);
......
......@@ -74,7 +74,8 @@ static inline void crouzeixRaviart(const std::vector<double> &U,std::vector<doub
F[i] = U[0] * (1.-2.*eta[i]) + U[1] * (2.*(xsi[i]+eta[i])-1.) + U[2] * (1-2.*xsi[i]);
}
discreteFace::discreteFace(GModel *model, int num) : GFace(model, num)
discreteFace::discreteFace(GModel *model, int num, bool meshable)
: GFace(model, num), _meshable(meshable)
{
Surface *s = CreateSurface(num, MSH_SURF_DISCRETE);
Tree_Add(model->getGEOInternals()->Surfaces, &s);
......@@ -188,18 +189,13 @@ void discreteFace::secondDer(const SPoint2 &param,
void discreteFace::createGeometry()
{
checkAndFixOrientation();
#if defined(HAVE_SOLVER) && defined(HAVE_ANN)
int order = 1;
int nPart = 2;
double eta = .5*5/(2.*3.14);
if (!_atlas.empty())return;
if (!_atlas.empty()) return;
double dtSplit = 0.0;
......@@ -217,7 +213,7 @@ void discreteFace::createGeometry()
(toSplit.top())->aspectRatio() > eta ||
(toSplit.top())->seamPoint){
while( !toSplit.empty()){
while(!toSplit.empty()){
std::vector<triangulation*> part;
triangulation* tosplit = toSplit.top();
toSplit.pop();
......@@ -245,7 +241,6 @@ void discreteFace::createGeometry()
}
updateTopology(toParam);
/*
FILE* debug = Fopen("tralala-init.pos","w");
fprintf(debug,"View \"discreteEdges\"{\n");
......@@ -272,13 +267,11 @@ void discreteFace::createGeometry()
*/
for(unsigned int i=0; i<toParam.size(); i++){
fillHoles(toParam[i]);
//sprintf(name,"mapFilled%d.pos",i);
//toParam[i]->print(name, toParam[i]->idNum);
}
for(unsigned int i=0; i<toParam.size(); i++){
discreteDiskFace *df = new discreteDiskFace (this,toParam[i], order,(_CAD.empty() ? NULL : &_CAD));
df->printAtlasMesh();
......@@ -340,59 +333,36 @@ void discreteFace::gatherMeshes()
void discreteFace::mesh(bool verbose)
{
#if defined(HAVE_ANN) && defined(HAVE_SOLVER) && defined(HAVE_MESH)
/*
for(unsigned int j=0; j<_atlas.size(); j++){
std::list<GEdge*> ge = _atlas[j]->edges();
for(std::list<GEdge*>::iterator it = ge.begin(); it!=ge.end(); ++it){
char myname[256];
sprintf(myname,"tralala%d_%d.pos",(*it)->tag(),j+1);
FILE* debug = Fopen(myname,"w");
fprintf(debug,"View \"discreteEdges\"{\n");
std::vector<MLine*> ml = (*it)->lines;
//printf("___map %d (%d), ge %d___ (%p)\n",j+1,_atlas[j]->tag(),(*it)->tag(),(*it));
for(unsigned int i=0; i<ml.size(); i++){
ml[i]->writePOS(debug,false,true,false,false,false,false,1.,(*it)->tag());
//printf("%d[%d;%d]--",ml[i]->getNum(),ml[i]->getVertex(0)->getNum(),ml[i]->getVertex(1)->getNum());
}
//printf("\n");
fprintf(debug,"};");
fclose(debug);
}
}
*/
if (!CTX::instance()->meshDiscrete) return;
if(!_meshable && !CTX::instance()->meshDiscrete) return;
//Msg::Info("Discrete Face %d is going to be meshed",tag());
for (unsigned int i=0;i<_atlas.size();i++){
// {
// void openProblemsON(void);
// if (tag() == 3) openProblemsON();
// }
_atlas[i]->mesh(verbose);
// {
// void openProblemsOFF(void);
// if (tag()==3) openProblemsOFF();
// }
/*
const char *name = "atlas%d";
char filename[256];
sprintf(filename,name,i);t0
_atlas[i]->printPhysicalMesh(filename);*/
}
gatherMeshes();
meshStatistics.status = GFace::DONE;
#endif
}
void discreteFace::checkAndFixOrientation()
{
// first of all, all the triangles have to be oriented in the same way
std::map<MEdge,std::vector<MElement*>,Less_Edge> ed2tri; // edge to 1 or 2 triangle(s)
......@@ -408,7 +378,8 @@ void discreteFace::checkAndFixOrientation()
std::map<MElement*,std::vector<MElement*> > neighbors;
for (unsigned int i=0; i<triangles.size(); ++i){
MElement* e = triangles[i];
for(int j=0; j<e->getNumEdges(); j++){ // #improveme: efficiency could be improved by setting neighbors mutually
for(int j=0; j<e->getNumEdges(); j++){
// #improveme: efficiency could be improved by setting neighbors mutually
std::vector<MElement*> my_mt = ed2tri[e->getEdge(j)];
if (my_mt.size() > 1){// my_mt.size() = {1;2}
MElement* neighTri = my_mt[0] == e ? my_mt[1] : my_mt[0];
......@@ -472,8 +443,8 @@ void discreteFace::checkAndFixOrientation()
} // end while
}
void discreteFace::setupDiscreteVertex(GVertex*dv,MVertex*mv,std::set<MVertex*>*trash){
void discreteFace::setupDiscreteVertex(GVertex*dv,MVertex*mv,std::set<MVertex*>*trash)
{
mv->setEntity(dv);
dv->mesh_vertices.push_back(mv);
this->model()->add(dv);
......@@ -494,13 +465,11 @@ void discreteFace::setupDiscreteEdge(discreteEdge*de,std::vector<MLine*>mlines,
de->createGeometry();
de->getBeginVertex()->addEdge(de);
de->getEndVertex()->addEdge(de);
}
// split old GEdge's
void discreteFace::splitDiscreteEdge(GEdge *de , GVertex *gv, discreteEdge* newE[2])
{
MVertex *vend = de->getEndVertex()->mesh_vertices[0];
int mytag = this->model()->getMaxElementaryNumber(1) + 1;
......@@ -560,7 +529,8 @@ void discreteFace::split(triangulation* trian,std::vector<triangulation*> &parti
#if defined(HAVE_SOLVER) && defined(HAVE_ANN) && defined(HAVE_METIS)
int nVertex = trian->tri.size(); // number of elements
int nEdge = trian->ed2tri.size() - trian->borderEdg.size();// number of edges, (without the boundary ones)
// number of edges, (without the boundary ones)
int nEdge = trian->ed2tri.size() - trian->borderEdg.size();
std::vector<int> idx;
idx.resize(nVertex+1);
......@@ -777,7 +747,8 @@ void discreteFace::updateTopology(std::vector<triangulation*>&partition)
}
void discreteFace::fillHoles(triangulation* trian)
{// #improveme moving the center
{
// #improveme moving the center
#if defined(HAVE_SOLVER) && defined(HAVE_ANN)
std::map<double,std::vector<MVertex*> > bords = trian->bord;
std::map<double,std::vector<MVertex*> >::reverse_iterator it = bords.rbegin();
......@@ -848,8 +819,6 @@ void discreteFace::addTriangle(triangulation* trian, MTriangle* t)
#endif
}
void discreteFace::complex_crossField()
{
#if defined(HAVE_SOLVER) && defined(HAVE_ANN)
......@@ -987,9 +956,6 @@ void discreteFace::complex_crossField()
#endif
}
void discreteFace::crossField()
{
#if defined(HAVE_SOLVER) && defined(HAVE_ANN)
......@@ -1140,7 +1106,6 @@ void discreteFace::crossField()
#endif
}
void discreteFace::writeGEO(FILE *fp)
{
fprintf(fp, "Discrete Face(%d) = {",tag());
......
......@@ -18,10 +18,10 @@ class discreteDiskFace;
class triangulation;
class discreteFace : public GFace {
// FIXME we should at the end use a mesh() function that is specific to
// discreteFace; we should also SAVE those data's
private:
bool _meshable;
public:
discreteFace(GModel *model, int num);
discreteFace(GModel *model, int num, bool meshable=false);
virtual ~discreteFace() {}
void checkAndFixOrientation();
void setupDiscreteVertex(GVertex*,MVertex*,std::set<MVertex*>*);
......@@ -51,7 +51,7 @@ class discreteFace : public GFace {
void writeGEO(FILE *fp);
void createGeometry();
void gatherMeshes();
virtual void mesh (bool verbose);
virtual void mesh(bool verbose);
std::vector<discreteDiskFace*> _atlas;
std::vector<GFace*> _CAD;
std::map<MEdge,std::vector<int>,Less_Edge> allEdg2Tri;
......
......@@ -446,7 +446,7 @@ static void Mesh2D(GModel *m)
// meshes) is global as it depends on a smooth normal field generated from the
// surface mesh of the source surfaces
if(!Mesh2DWithBoundaryLayers(m)){
std::set<GFace*, GEntityLessThan> cf, f;
std::set<GFace*, GEntityLessThan> f;
for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it)
f.insert(*it);
......@@ -463,27 +463,7 @@ static void Mesh2D(GModel *m)
for(size_t K = 0 ; K < temp.size() ; K++){
if (temp[K]->meshStatistics.status == GFace::PENDING){
backgroundMesh::current()->unset();
// meshGFace mesher(true);
temp[K]->mesh(true);
#if defined(HAVE_BFGS)
if(CTX::instance()->mesh.optimizeLloyd){
if (temp[K]->geomType()==GEntity::Plane ||
temp[K]->geomType()==GEntity::RuledSurface) {
if (temp[K]->meshAttributes.method != MESH_TRANSFINITE &&
!temp[K]->meshAttributes.extrude) {
smoothing smm(CTX::instance()->mesh.optimizeLloyd, 6);
//m->writeMSH("beforeLLoyd.msh");
smm.optimize_face(temp[K]);
int rec = ((CTX::instance()->mesh.recombineAll ||
temp[K]->meshAttributes.recombine) &&
!CTX::instance()->mesh.recombine3DAll);
//m->writeMSH("afterLLoyd.msh");
if (rec) recombineIntoQuads(temp[K]);
//m->writeMSH("afterRecombine.msh");
}
}
}
#endif
#if defined(_OPENMP)
#pragma omp critical
#endif
......@@ -496,35 +476,6 @@ static void Mesh2D(GModel *m)
#if defined(_OPENMP)
#pragma omp master
#endif
for(std::set<GFace*, GEntityLessThan>::iterator it = cf.begin();
it != cf.end(); ++it){
if ((*it)->meshStatistics.status == GFace::PENDING){
backgroundMesh::current()->unset();
// meshGFace mesher(true);
(*it)->mesh(true);
#if defined(HAVE_BFGS)
if(CTX::instance()->mesh.optimizeLloyd){
if ((*it)->geomType()==GEntity::Plane ||
(*it)->geomType()==GEntity::RuledSurface) {
if ((*it)->meshAttributes.method != MESH_TRANSFINITE &&
!(*it)->meshAttributes.extrude) {
smoothing smm(CTX::instance()->mesh.optimizeLloyd, 6);
//m->writeMSH("beforeLLoyd.msh");
smm.optimize_face(*it);
int rec = ((CTX::instance()->mesh.recombineAll ||
(*it)->meshAttributes.recombine) &&
!CTX::instance()->mesh.recombine3DAll);
//m->writeMSH("afterLLoyd.msh");
if (rec) recombineIntoQuads(*it);
//m->writeMSH("afterRecombine.msh");
}
}
}
#endif
nPending++;
}
if(!nIter) Msg::ProgressMeter(nPending, nTot, false, "Meshing 2D...");
}
if(!nPending) break;
if(nIter++ > 10) break;
}
......
......@@ -166,7 +166,6 @@ Cos return tCos;
Cosh return tCosh;
Cpu return tCpu;
CreateTopology return tCreateTopology;
CreateTopologyNoHoles return tCreateTopologyNoHoles;
CurrentDir return tCurrentDirectory;
CurrentDirectory return tCurrentDirectory;
Cylinder return tCylinder;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -188,7 +188,7 @@ struct doubleXstring{
%token tSyncModel tNewModel
%token tOnelabAction tOnelabRun tCodeName
%token tCpu tMemory tTotalMemory
%token tCreateTopology tCreateTopologyNoHoles
%token tCreateTopology
%token tDistanceFunction tDefineConstant tUndefineConstant
%token tDefineNumber tDefineStruct tNameStruct tDimNameSpace tAppend
%token tDefineString tSetNumber tSetString
......@@ -3324,10 +3324,6 @@ Command :
{
GModel::current()->createTopologyFromMesh();
}
| tCreateTopologyNoHoles tEND
{
GModel::current()->createTopologyFromMesh(1);
}
| tRefineMesh tEND
{
if(GModel::current()->getOCCInternals() &&
......
......@@ -23,19 +23,14 @@ Line(4) = {9, 3}; Line(5) = {3, 4}; Line(6) = {4, 7};
Line(7) = {7, 6}; Line(8) = {6, 1}; Spline(9) = {7, 5, 9};
Line(10) = {6, 8};
Line Loop(11) = {5, 6, 9, 4}; Surface(12) = {11};
Line Loop(13) = {9, -3, -10, -7}; Surface(14) = {13};
Line Loop(15) = {10, -2, -1, -8}; Surface(16) = {15};
// FIXME - the global "meshDiscrete" option will be replaced by meshing
// constraints
General.MeshDiscrete = 1;
Line Loop(11) = {5, 6, 9, 4}; Surface(1) = {11};
Line Loop(13) = {9, -3, -10, -7}; Surface(5) = {13};
Line Loop(15) = {10, -2, -1, -8}; Surface(10) = {15};
// Treat lines 2, 3 and 4 as a single line
Compound Line{2, 3, 4};
Compound Line{2, 3, 4}; // FIXME: not (re)implemeted yet
// Idem with lines 6, 7 and 8
Compound Line{6, 7, 8};
Compound Line{6, 7, 8}; // FIXME: not (re)implemeted yet
// Treat surfaces 12, 14 and 16 as a single surface
Compound Surface{12, 14, 16};
Compound Surface{1, 5, 10};
......@@ -10,22 +10,22 @@
// them to remesh STL files, even if in this case there's usually only a single
// elementary geometrical entity per compound.
// FIXME - the global "meshDiscrete" option will be replaced by meshing
// constraints "Compound Surface{...};"
// FIXME: compute parametrization of discrete surfaces read from mesh file
General.MeshDiscrete = 1;
// Let's merge the mesh that we would like to remesh. This mesh was reclassified
// ("colored") from an initial STL triangulation using the "Reclassify 2D" tool
// in Gmsh, so that we could split it along sharp geometrical features.
Merge "t13_data.msh";
RefineMesh;
// We can now define a compound line (resp. surface) for each discrete line
// (resp. surface) in the model
// FIXME: this is currently not used
ll[] = Line {:};
ss[] = Surface {:};
// FIXME: does not do anything yet (because the underlying surfaces are
// discrete):
Compound Surface{ss[]};
// And we can create the volume based on the new compound entities
Surface Loop(1) = {ss[]};
Volume(1) = {1};
......@@ -36,7 +36,7 @@ Field[1].F = "2.0";
Background Field = 1;
DefineConstant[
funny = {1, Choices{0,1},
funny = {0, Choices{0,1},
Name "Parameters/Apply funny mesh size field?"}
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment