Skip to content
Snippets Groups Projects
Commit 74fc3b00 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix compile

parent daab710d
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
static inline void functionShapes(int p, double Xi[2], double* phi) static inline void functionShapes(int p, double Xi[2], double* phi)
{ {
switch(p){ switch(p){
case 1: case 1:
...@@ -48,23 +47,20 @@ static inline void functionShapes(int p, double Xi[2], double* phi) ...@@ -48,23 +47,20 @@ static inline void functionShapes(int p, double Xi[2], double* phi)
break; break;
default: default:
Msg::Error("(discreteDiskFace) static inline functionShapes, only first and second order available; order %d requested.",p); Msg::Error("(discreteDiskFace) static inline functionShapes, only first "
"and second order available; order %d requested.", p);
break; break;
} }
} }
static inline void derivativeShapes(int p, double Xi[2], double phi[6][2]) static inline void derivativeShapes(int p, double Xi[2], double phi[6][2])
{ {
switch(p){ switch(p){
case 1: case 1:
phi[0][0] = -1. ; phi[0][1] = -1.; phi[0][0] = -1. ; phi[0][1] = -1.;
phi[1][0] = 1. ; phi[1][1] = 0.; phi[1][0] = 1. ; phi[1][1] = 0.;
phi[2][0] = 0. ; phi[2][1] = 1.; phi[2][0] = 0. ; phi[2][1] = 1.;
break; break;
case 2: case 2:
...@@ -77,14 +73,14 @@ static inline void derivativeShapes(int p, double Xi[2], double phi[6][2]) ...@@ -77,14 +73,14 @@ static inline void derivativeShapes(int p, double Xi[2], double phi[6][2])
break; break;
default: default:
Msg::Error("(discreteDiskFace) static inline derivativeShapes, only first and second order available; order %d requested.",p); Msg::Error("(discreteDiskFace) static inline derivativeShapes, only first and "
"second order available; order %d requested.",p);
break; break;
} }
} }
static inline bool uv2xi(discreteDiskFaceTriangle* my_ddft, double U[2], double Xi[2]){ static inline bool uv2xi(discreteDiskFaceTriangle* my_ddft, double U[2], double Xi[2])
{
double M[2][2], R[2]; double M[2][2], R[2];
const SPoint3 p0 = my_ddft->p[0]; const SPoint3 p0 = my_ddft->p[0];
const SPoint3 p1 = my_ddft->p[1]; const SPoint3 p1 = my_ddft->p[1];
...@@ -142,7 +138,6 @@ static inline bool uv2xi(discreteDiskFaceTriangle* my_ddft, double U[2], double ...@@ -142,7 +138,6 @@ static inline bool uv2xi(discreteDiskFaceTriangle* my_ddft, double U[2], double
return true; return true;
} }
// The three following things are mandatory to manipulate octrees (octree in (u;v)). // The three following things are mandatory to manipulate octrees (octree in (u;v)).
static void discreteDiskFaceBB(void *a, double*mmin, double*mmax) static void discreteDiskFaceBB(void *a, double*mmin, double*mmax)
{ {
...@@ -178,7 +173,6 @@ static void discreteDiskFaceCentroid(void *a, double*c) ...@@ -178,7 +173,6 @@ static void discreteDiskFaceCentroid(void *a, double*c)
static int discreteDiskFaceInEle(void *a, double*c)// # mark static int discreteDiskFaceInEle(void *a, double*c)// # mark
{ {
discreteDiskFaceTriangle *t = (discreteDiskFaceTriangle *)a; discreteDiskFaceTriangle *t = (discreteDiskFaceTriangle *)a;
double Xi[2]; double Xi[2];
double U[2] = {c[0],c[1]}; double U[2] = {c[0],c[1]};
...@@ -191,8 +185,10 @@ static int discreteDiskFaceInEle(void *a, double*c)// # mark ...@@ -191,8 +185,10 @@ static int discreteDiskFaceInEle(void *a, double*c)// # mark
return 0; return 0;
} }
static bool orderVertices(const double &tot_length, const std::vector<MVertex*> &l, std::vector<double> &coord) static bool orderVertices(const double &tot_length, const std::vector<MVertex*> &l,
{ // called once by constructor ; organize the vertices for the linear system expressing the mapping std::vector<double> &coord)
{ // called once by constructor ; organize the vertices for the linear system
// expressing the mapping
coord.clear(); coord.clear();
coord.push_back(0.); coord.push_back(0.);
...@@ -211,14 +207,12 @@ static bool orderVertices(const double &tot_length, const std::vector<MVertex*> ...@@ -211,14 +207,12 @@ static bool orderVertices(const double &tot_length, const std::vector<MVertex*>
first = next; first = next;
} }
return true; return true;
} }
/*BUILDER*/ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation,
discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation, int p, std::vector<GFace*> *CAD) : int p, std::vector<GFace*> *CAD) :
GFace(gf->model(),123), _parent (gf),_ddft(NULL) GFace(gf->model(),123), _parent (gf), _ddft(NULL), oct(NULL)
{ {
initialTriangulation = diskTriangulation; initialTriangulation = diskTriangulation;
std::vector<MElement*> mesh = diskTriangulation->tri; std::vector<MElement*> mesh = diskTriangulation->tri;
...@@ -241,7 +235,8 @@ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation, ...@@ -241,7 +235,8 @@ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation,
if (!CAD) vv = new MFaceVertex ( v->x(), v->y(), v->z(), v->onWhat(), 0, 0); if (!CAD) vv = new MFaceVertex ( v->x(), v->y(), v->z(), v->onWhat(), 0, 0);
else{ else{
GFace *cad = (*CAD)[i]; GFace *cad = (*CAD)[i];
if(cad != v->onWhat())Msg::Fatal("Line %d FILE %s : erroneous cad list",__LINE__,__FILE__); if(cad != v->onWhat())
Msg::Fatal("Line %d FILE %s : erroneous cad list",__LINE__,__FILE__);
double pu,pv; v->getParameter(0,pu);v->getParameter(1,pv); double pu,pv; v->getParameter(0,pu);v->getParameter(1,pv);
vv = new MFaceVertex ( v->x(), v->y(), v->z(), v->onWhat(), pu, pv); vv = new MFaceVertex ( v->x(), v->y(), v->z(), v->onWhat(), pu, pv);
} }
...@@ -295,7 +290,8 @@ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation, ...@@ -295,7 +290,8 @@ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation,
buildOct(CAD); buildOct(CAD);
if (!checkOrientationUV()){ if (!checkOrientationUV()){
Msg::Info("discreteDIskFace:: parametrization is not one-to-one; fixing the discrete system."); Msg::Info("discreteDIskFace:: parametrization is not one-to-one; fixing "
"the discrete system.");
parametrize(true); parametrize(true);
buildOct(CAD); buildOct(CAD);
} }
...@@ -340,7 +336,6 @@ void discreteDiskFace::buildOct(std::vector<GFace*> *CAD) const ...@@ -340,7 +336,6 @@ void discreteDiskFace::buildOct(std::vector<GFace*> *CAD) const
Octree_Arrange(oct); Octree_Arrange(oct);
} }
bool discreteDiskFace::parametrize(bool one2one) const bool discreteDiskFace::parametrize(bool one2one) const
{ // #improveme { // #improveme
...@@ -373,15 +368,14 @@ bool discreteDiskFace::parametrize(bool one2one) const ...@@ -373,15 +368,14 @@ bool discreteDiskFace::parametrize(bool one2one) const
} }
} }
Msg::Debug("Creating term %d dofs numbered %d fixed", Msg::Debug("Creating term %d dofs numbered %d fixed",
myAssemblerU.sizeOfR() + myAssemblerV.sizeOfR(), myAssemblerU.sizeOfF() + myAssemblerV.sizeOfF()); myAssemblerU.sizeOfR() + myAssemblerV.sizeOfR(),
myAssemblerU.sizeOfF() + myAssemblerV.sizeOfF());
double t1 = Cpu(); double t1 = Cpu();
simpleFunction<double> ONE(1.0); simpleFunction<double> ONE(1.0);
if (one2one){ if (one2one){
convexLaplaceTerm mappingU(0, 1, &ONE); convexLaplaceTerm mappingU(0, 1, &ONE);
convexLaplaceTerm mappingV(0, 1, &ONE); convexLaplaceTerm mappingV(0, 1, &ONE);
...@@ -431,7 +425,6 @@ bool discreteDiskFace::parametrize(bool one2one) const ...@@ -431,7 +425,6 @@ bool discreteDiskFace::parametrize(bool one2one) const
delete lsys_v; delete lsys_v;
return true; return true;
} }
void discreteDiskFace::getTriangleUV(const double u,const double v, void discreteDiskFace::getTriangleUV(const double u,const double v,
...@@ -448,9 +441,8 @@ void discreteDiskFace::getTriangleUV(const double u,const double v, ...@@ -448,9 +441,8 @@ void discreteDiskFace::getTriangleUV(const double u,const double v,
_eta = Xi[1]; _eta = Xi[1];
} }
bool discreteDiskFace::checkOrientationUV()
bool discreteDiskFace::checkOrientationUV(){ {
discreteDiskFaceTriangle *ct; discreteDiskFaceTriangle *ct;
if(_order==1){ if(_order==1){
...@@ -550,7 +542,8 @@ SPoint2 discreteDiskFace::parFromVertex(MVertex *v) const ...@@ -550,7 +542,8 @@ SPoint2 discreteDiskFace::parFromVertex(MVertex *v) const
Msg::Fatal("FIXME TO DO %d %s",__LINE__,__FILE__); Msg::Fatal("FIXME TO DO %d %s",__LINE__,__FILE__);
} }
else if (v->onWhat()->dim()==0) else if (v->onWhat()->dim()==0)
Msg::Fatal("discreteDiskFace::parFromVertex vertex classified on a model vertex that is not part of the face"); Msg::Fatal("discreteDiskFace::parFromVertex vertex classified on a model "
"vertex that is not part of the face");
return SPoint2(0,0); return SPoint2(0,0);
} }
...@@ -643,25 +636,29 @@ void discreteDiskFace::secondDer(const SPoint2 &param, ...@@ -643,25 +636,29 @@ void discreteDiskFace::secondDer(const SPoint2 &param,
return; return;
} }
void discreteDiskFace::putOnView() void discreteDiskFace::putOnView()
{ {
char mybuffer [64]; char mybuffer [64];
snprintf(mybuffer,sizeof(mybuffer),"param_u_part%d_order%d.pos",initialTriangulation->idNum,_order); snprintf(mybuffer,sizeof(mybuffer),"param_u_part%d_order%d.pos",
initialTriangulation->idNum,_order);
FILE* view_u = Fopen(mybuffer,"w"); FILE* view_u = Fopen(mybuffer,"w");
snprintf(mybuffer,sizeof(mybuffer),"param_v_part%d_order%d.pos",initialTriangulation->idNum,_order); snprintf(mybuffer,sizeof(mybuffer),"param_v_part%d_order%d.pos",
initialTriangulation->idNum,_order);
FILE* view_v = Fopen(mybuffer,"w"); FILE* view_v = Fopen(mybuffer,"w");
snprintf(mybuffer,sizeof(mybuffer),"UVx_part%d_order%d.pos",initialTriangulation->idNum,_order); snprintf(mybuffer,sizeof(mybuffer),"UVx_part%d_order%d.pos",
initialTriangulation->idNum,_order);
FILE* UVx = Fopen(mybuffer,"w"); FILE* UVx = Fopen(mybuffer,"w");
snprintf(mybuffer,sizeof(mybuffer),"UVy_part%d_order%d.pos",initialTriangulation->idNum,_order); snprintf(mybuffer,sizeof(mybuffer),"UVy_part%d_order%d.pos",
initialTriangulation->idNum,_order);
FILE* UVy = Fopen(mybuffer,"w"); FILE* UVy = Fopen(mybuffer,"w");
snprintf(mybuffer,sizeof(mybuffer),"UVz_part%d_order%d.pos",initialTriangulation->idNum,_order); snprintf(mybuffer,sizeof(mybuffer),"UVz_part%d_order%d.pos",
initialTriangulation->idNum,_order);
FILE* UVz = Fopen(mybuffer,"w"); FILE* UVz = Fopen(mybuffer,"w");
if(view_u && view_v && UVx && UVy && UVz){ if(view_u && view_v && UVx && UVy && UVz){
...@@ -687,14 +684,18 @@ void discreteDiskFace::putOnView() ...@@ -687,14 +684,18 @@ void discreteDiskFace::putOnView()
fprintf(UVz,"ST%d(",_order); fprintf(UVz,"ST%d(",_order);
} }
for (int j=0; j<_N-1; j++){ for (int j=0; j<_N-1; j++){
fprintf(view_u,"%g,%g,%g,",my_ddft->tri->getVertex(j)->x(),my_ddft->tri->getVertex(j)->y(),my_ddft->tri->getVertex(j)->z()); fprintf(view_u,"%g,%g,%g,",my_ddft->tri->getVertex(j)->x(),
fprintf(view_v,"%g,%g,%g,",my_ddft->tri->getVertex(j)->x(),my_ddft->tri->getVertex(j)->y(),my_ddft->tri->getVertex(j)->z()); my_ddft->tri->getVertex(j)->y(),my_ddft->tri->getVertex(j)->z());
fprintf(view_v,"%g,%g,%g,",my_ddft->tri->getVertex(j)->x(),
my_ddft->tri->getVertex(j)->y(),my_ddft->tri->getVertex(j)->z());
fprintf(UVx,"%g,%g,%g,",my_ddft->p[j].x(),my_ddft->p[j].y(),0.); fprintf(UVx,"%g,%g,%g,",my_ddft->p[j].x(),my_ddft->p[j].y(),0.);
fprintf(UVy,"%g,%g,%g,",my_ddft->p[j].x(),my_ddft->p[j].y(),0.); fprintf(UVy,"%g,%g,%g,",my_ddft->p[j].x(),my_ddft->p[j].y(),0.);
fprintf(UVz,"%g,%g,%g,",my_ddft->p[j].x(),my_ddft->p[j].y(),0.); fprintf(UVz,"%g,%g,%g,",my_ddft->p[j].x(),my_ddft->p[j].y(),0.);
} }
fprintf(view_u,"%g,%g,%g){",my_ddft->tri->getVertex(_N-1)->x(),my_ddft->tri->getVertex(_N-1)->y(),my_ddft->tri->getVertex(_N-1)->z()); fprintf(view_u,"%g,%g,%g){",my_ddft->tri->getVertex(_N-1)->x(),
fprintf(view_v,"%g,%g,%g){",my_ddft->tri->getVertex(_N-1)->x(),my_ddft->tri->getVertex(_N-1)->y(),my_ddft->tri->getVertex(_N-1)->z()); my_ddft->tri->getVertex(_N-1)->y(),my_ddft->tri->getVertex(_N-1)->z());
fprintf(view_v,"%g,%g,%g){",my_ddft->tri->getVertex(_N-1)->x(),
my_ddft->tri->getVertex(_N-1)->y(),my_ddft->tri->getVertex(_N-1)->z());
fprintf(UVx,"%g,%g,%g){",my_ddft->p[_N-1].x(),my_ddft->p[_N-1].y(),0.); fprintf(UVx,"%g,%g,%g){",my_ddft->p[_N-1].x(),my_ddft->p[_N-1].y(),0.);
fprintf(UVy,"%g,%g,%g){",my_ddft->p[_N-1].x(),my_ddft->p[_N-1].y(),0.); fprintf(UVy,"%g,%g,%g){",my_ddft->p[_N-1].x(),my_ddft->p[_N-1].y(),0.);
fprintf(UVz,"%g,%g,%g){",my_ddft->p[_N-1].x(),my_ddft->p[_N-1].y(),0.); fprintf(UVz,"%g,%g,%g){",my_ddft->p[_N-1].x(),my_ddft->p[_N-1].y(),0.);
...@@ -745,7 +746,7 @@ void discreteDiskFace::putOnView() ...@@ -745,7 +746,7 @@ void discreteDiskFace::putOnView()
*/ */
} }
// useful for mesh generators ---------------------------------------- // useful for mesh generators
// Intersection of a circle and a plane // Intersection of a circle and a plane
GPoint discreteDiskFace::intersectionWithCircle(const SVector3 &n1, const SVector3 &n2, GPoint discreteDiskFace::intersectionWithCircle(const SVector3 &n1, const SVector3 &n2,
const SVector3 &p, const double &d, const SVector3 &p, const double &d,
...@@ -765,9 +766,12 @@ GPoint discreteDiskFace::intersectionWithCircle(const SVector3 &n1, const SVecto ...@@ -765,9 +766,12 @@ GPoint discreteDiskFace::intersectionWithCircle(const SVector3 &n1, const SVecto
// the point is situated in the half plane defined // the point is situated in the half plane defined
// by direction n1 and point p (exclude the one on the // by direction n1 and point p (exclude the one on the
// other side) // other side)
SVector3 v0(ct->tri->getVertex(0)->x(),ct->tri->getVertex(0)->y(),ct->tri->getVertex(0)->z()); SVector3 v0(ct->tri->getVertex(0)->x(),ct->tri->getVertex(0)->y(),
SVector3 v1(ct->tri->getVertex(1)->x(),ct->tri->getVertex(1)->y(),ct->tri->getVertex(1)->z()); ct->tri->getVertex(0)->z());
SVector3 v2(ct->tri->getVertex(2)->x(),ct->tri->getVertex(2)->y(),ct->tri->getVertex(2)->z()); SVector3 v1(ct->tri->getVertex(1)->x(),ct->tri->getVertex(1)->y(),
ct->tri->getVertex(1)->z());
SVector3 v2(ct->tri->getVertex(2)->x(),ct->tri->getVertex(2)->y(),
ct->tri->getVertex(2)->z());
SVector3 t1 = v1 - v0; SVector3 t1 = v1 - v0;
SVector3 t2 = v2 - v0; SVector3 t2 = v2 - v0;
// let us first compute point q to be the intersection // let us first compute point q to be the intersection
...@@ -849,5 +853,4 @@ GPoint discreteDiskFace::intersectionWithCircle(const SVector3 &n1, const SVecto ...@@ -849,5 +853,4 @@ GPoint discreteDiskFace::intersectionWithCircle(const SVector3 &n1, const SVecto
return pp; return pp;
} }
#endif #endif
...@@ -23,28 +23,26 @@ ...@@ -23,28 +23,26 @@
#include "PView.h" #include "PView.h"
#include "robustPredicates.h" #include "robustPredicates.h"
/*inline utilities*/ inline int nodeLocalNum(MElement* e, MVertex* v)
inline int nodeLocalNum(MElement* e, MVertex* v) {// const {
for(int i=0; i<e->getNumVertices(); i++) for(int i=0; i<e->getNumVertices(); i++)
if (v == e->getVertex(i)) if (v == e->getVertex(i))
return i; return i;
return -1; return -1;
} }
inline int edgeLocalNum(MElement* e, MEdge ed) {// const
inline int edgeLocalNum(MElement* e, MEdge ed)
{
for(int i=0; i<e->getNumEdges(); i++) for(int i=0; i<e->getNumEdges(); i++)
if (ed == e->getEdge(i)) if (ed == e->getEdge(i))
return i; return i;
return -1; return -1;
} }
/*various classes*/
class ANNkd_tree; class ANNkd_tree;
class Octree; class Octree;
class GRbf; class GRbf;
class triangulation { class triangulation {
public: public:
...@@ -52,18 +50,20 @@ class triangulation { ...@@ -52,18 +50,20 @@ class triangulation {
// attributes // attributes
std::vector<MElement*> tri;// triangles std::vector<MElement*> tri;// triangles
std::set<MVertex*> vert;// nodes std::set<MVertex*> vert;// nodes
std::map<MEdge,std::vector<int>,Less_Edge> ed2tri; // edge to 1 or 2 triangle(s), their num into the vector of MElement* // edge to 1 or 2 triangle(s), their num into the vector of MElement*
std::map<MEdge,std::vector<int>,Less_Edge> ed2tri;
std::map<double,std::vector<MVertex*> > bord; //border(s) std::map<double,std::vector<MVertex*> > bord; //border(s)
std::set<MEdge,Less_Edge> borderEdg; // border edges std::set<MEdge,Less_Edge> borderEdg; // border edges
GFace *gf; GFace *gf;
int idNum; // number of identification, for hashing purposes int idNum; // number of identification, for hashing purposes
//methods int genus()
int genus(){ {
return ( -vert.size() + ed2tri.size() - tri.size() + 2 - bord.size() )/2; return ( -vert.size() + ed2tri.size() - tri.size() + 2 - bord.size() )/2;
} }
void assignVert(){ void assignVert()
{
for(unsigned int i = 0; i < tri.size(); ++i){ for(unsigned int i = 0; i < tri.size(); ++i){
MElement* t = tri[i]; MElement* t = tri[i];
for(int j = 0; j < t->getNumVertices() ; j++){ for(int j = 0; j < t->getNumVertices() ; j++){
...@@ -74,7 +74,8 @@ class triangulation { ...@@ -74,7 +74,8 @@ class triangulation {
} }
} }
void assignEd2tri(){ void assignEd2tri()
{
for(unsigned int i = 0; i < tri.size(); ++i){ for(unsigned int i = 0; i < tri.size(); ++i){
MElement *t = tri[i]; MElement *t = tri[i];
for(int j = 0; j < 3 ; j++){ for(int j = 0; j < 3 ; j++){
...@@ -84,7 +85,8 @@ class triangulation { ...@@ -84,7 +85,8 @@ class triangulation {
} }
} }
void assignBord(){ void assignBord()
{
for(unsigned int i = 0; i < tri.size(); ++i){ for(unsigned int i = 0; i < tri.size(); ++i){
MElement *t = tri[i]; MElement *t = tri[i];
for(int j = 0; j < t->getNumEdges() ; j++){ for(int j = 0; j < t->getNumEdges() ; j++){
...@@ -109,7 +111,8 @@ class triangulation { ...@@ -109,7 +111,8 @@ class triangulation {
vecver.erase(vecver.begin()); vecver.erase(vecver.begin());
std::map<MVertex*,std::vector<MVertex*> >::iterator im = firstNode2Edge.find(first); std::map<MVertex*,std::vector<MVertex*> >::iterator im = firstNode2Edge.find(first);
if (im != firstNode2Edge.end()) Msg::Fatal("Incorrect topology in discreteDiskFace %d", gf->tag()); if (im != firstNode2Edge.end())
Msg::Error("Incorrect topology in discreteDiskFace %d", gf->tag());
firstNode2Edge[first] = vecver; firstNode2Edge[first] = vecver;
firstNode2Edge[first].push_back(last); firstNode2Edge[first].push_back(last);
} }
...@@ -121,15 +124,10 @@ class triangulation { ...@@ -121,15 +124,10 @@ class triangulation {
std::map<MVertex*,std::vector<MVertex*> >::iterator in = firstNode2Edge.begin(); std::map<MVertex*,std::vector<MVertex*> >::iterator in = firstNode2Edge.begin();
MVertex* previous = in->first; MVertex* previous = in->first;
while(in != firstNode2Edge.end()) { // it didn't find it while(in != firstNode2Edge.end()) { // it didn't find it
std::vector<MVertex*> myV = in->second; std::vector<MVertex*> myV = in->second;
for(unsigned int i=0; i<myV.size(); i++){ for(unsigned int i=0; i<myV.size(); i++){
loop.push_back(previous); loop.push_back(previous);
MVertex* current = myV[i]; MVertex* current = myV[i];
length += sqrt( (current->x()-previous->x()) * (current->x()-previous->x()) + length += sqrt( (current->x()-previous->x()) * (current->x()-previous->x()) +
(current->y()-previous->y()) * (current->y()-previous->y()) + (current->y()-previous->y()) * (current->y()-previous->y()) +
(current->z()-previous->z()) * (current->z()-previous->z()) ); (current->z()-previous->z()) * (current->z()-previous->z()) );
...@@ -139,22 +137,24 @@ class triangulation { ...@@ -139,22 +137,24 @@ class triangulation {
firstNode2Edge.erase(in); firstNode2Edge.erase(in);
in = firstNode2Edge.find(previous); in = firstNode2Edge.find(previous);
}// end while in }// end while in
bord.insert(std::make_pair(length,loop)); // it shouldn't be possible to have twice the same length ? actually, it is possible, but quite seldom #fixme ----> multimap ? bord.insert(std::make_pair(length,loop));
// it shouldn't be possible to have twice the same length ? actually, it
// is possible, but quite seldom #fixme ----> multimap ?
} // end while firstNode2Edge } // end while firstNode2Edge
}// end method }// end method
void assign(){ void assign()
{
assignVert(); assignVert();
assignEd2tri(); assignEd2tri();
assignBord(); assignBord();
} }
//builder
triangulation() : gf(0) {} triangulation() : gf(0) {}
triangulation(std::vector<MElement*> input, GFace* gface) : tri(input), gf(gface) {assign();} triangulation(std::vector<MElement*> input, GFace* gface)
: tri(input), gf(gface) { assign(); }
}; };
// --------------------
// triangles in the physical space xyz, with their parametric coordinates // triangles in the physical space xyz, with their parametric coordinates
class discreteDiskFaceTriangle { class discreteDiskFaceTriangle {
public: public:
...@@ -165,8 +165,6 @@ class discreteDiskFaceTriangle { ...@@ -165,8 +165,6 @@ class discreteDiskFaceTriangle {
discreteDiskFaceTriangle() : gf(0), tri(0) {} discreteDiskFaceTriangle() : gf(0), tri(0) {}
}; };
// --------------------
class discreteDiskFace : public GFace { class discreteDiskFace : public GFace {
GFace *_parent; GFace *_parent;
void buildOct(std::vector<GFace*> *CAD = NULL) const; void buildOct(std::vector<GFace*> *CAD = NULL) const;
...@@ -175,9 +173,11 @@ class discreteDiskFace : public GFace { ...@@ -175,9 +173,11 @@ class discreteDiskFace : public GFace {
bool checkOrientationUV(); bool checkOrientationUV();
public: public:
discreteDiskFace(GFace *parent, triangulation* diskTriangulation, int p=1, std::vector<GFace*> *CAD = NULL);// BUILDER discreteDiskFace(GFace *parent, triangulation* diskTriangulation,
int p=1, std::vector<GFace*> *CAD = NULL);
virtual ~discreteDiskFace(); virtual ~discreteDiskFace();
void getTriangleUV(const double u,const double v,discreteDiskFaceTriangle **mt, double &_u, double &_v) const; void getTriangleUV(const double u,const double v,discreteDiskFaceTriangle **mt,
double &_u, double &_v) const;
GPoint point(double par1, double par2) const; GPoint point(double par1, double par2) const;
SPoint2 parFromVertex(MVertex *v) const; SPoint2 parFromVertex(MVertex *v) const;
SVector3 normal(const SPoint2&) const; SVector3 normal(const SPoint2&) const;
...@@ -191,15 +191,12 @@ class discreteDiskFace : public GFace { ...@@ -191,15 +191,12 @@ class discreteDiskFace : public GFace {
const SVector3 &p, const double &d, const SVector3 &p, const double &d,
double uv[2]) const; double uv[2]) const;
protected: protected:
//------------------------------------------------
// a copy of the mesh that should not be destroyed // a copy of the mesh that should not be destroyed
triangulation* initialTriangulation; triangulation* initialTriangulation;
triangulation* geoTriangulation;// parametrized triangulation triangulation* geoTriangulation;// parametrized triangulation
std::vector<MElement*> discrete_triangles; std::vector<MElement*> discrete_triangles;
std::vector<MVertex*> discrete_vertices; std::vector<MVertex*> discrete_vertices;
//------------------------------------------------
//-----------------------------------------------
int _order; int _order;
int _N;// number of dof's for a triangle int _N;// number of dof's for a triangle
double _totLength; double _totLength;
...@@ -211,7 +208,7 @@ class discreteDiskFace : public GFace { ...@@ -211,7 +208,7 @@ class discreteDiskFace : public GFace {
mutable v2t_cont adjv; mutable v2t_cont adjv;
mutable std::map<MVertex*, Pair<SVector3,SVector3> > firstDerivatives; mutable std::map<MVertex*, Pair<SVector3,SVector3> > firstDerivatives;
mutable discreteDiskFaceTriangle *_ddft; mutable discreteDiskFaceTriangle *_ddft;
mutable Octree *oct = NULL; mutable Octree *oct;
mutable std::vector<double> _coords; mutable std::vector<double> _coords;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment