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

adaptive work

parent 64c23cd0
No related branches found
No related tags found
No related merge requests found
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
extern Context_T CTX; extern Context_T CTX;
#define GMSH_WINDOW_BOX FL_FLAT_BOX
#if defined(HAVE_CHACO) || defined(HAVE_METIS) #if defined(HAVE_CHACO) || defined(HAVE_METIS)
// Forward declarations of some callbacks // Forward declarations of some callbacks
......
...@@ -16,6 +16,8 @@ class drawTransform { ...@@ -16,6 +16,8 @@ class drawTransform {
drawTransform(){} drawTransform(){}
virtual ~drawTransform(){} virtual ~drawTransform(){}
virtual void transform(double &x, double &y, double &z){} virtual void transform(double &x, double &y, double &z){}
virtual void transformOneForm(double &x, double &y, double &z){}
virtual void transformTwoForm(double &x, double &y, double &z){}
virtual void setMatrix(double mat[3][3], double tra[3]){} virtual void setMatrix(double mat[3][3], double tra[3]){}
}; };
...@@ -80,6 +82,14 @@ class drawContext { ...@@ -80,6 +82,14 @@ class drawContext {
{ {
if(_transform) _transform->transform(x, y, z); if(_transform) _transform->transform(x, y, z);
} }
void transformOneForm(double &x, double &y, double &z)
{
if(_transform) _transform->transformOneForm(x, y, z);
}
void transformTwoForm(double &x, double &y, double &z)
{
if(_transform) _transform->transformTwoForm(x, y, z);
}
void buildRotationMatrix(); void buildRotationMatrix();
void setQuaternion(double p1x, double p1y, double p2x, double p2y); void setQuaternion(double p1x, double p1y, double p2x, double p2y);
void addQuaternion(double p1x, double p1y, double p2x, double p2y); void addQuaternion(double p1x, double p1y, double p2x, double p2y);
......
...@@ -179,7 +179,7 @@ class drawGEdge { ...@@ -179,7 +179,7 @@ class drawGEdge {
glColor4ubv((GLubyte *) & CTX.color.geom.tangents); glColor4ubv((GLubyte *) & CTX.color.geom.tangents);
double x = p.x(), y = p.y(), z = p.z(); double x = p.x(), y = p.y(), z = p.z();
_ctx->transform(x, y, z); _ctx->transform(x, y, z);
// FIXME: transform the tangent _ctx->transformOneForm(der[0], der[1], der[2]);
_ctx->drawVector(CTX.vector_type, 0, CTX.arrow_rel_head_radius, _ctx->drawVector(CTX.vector_type, 0, CTX.arrow_rel_head_radius,
CTX.arrow_rel_stem_length, CTX.arrow_rel_stem_radius, CTX.arrow_rel_stem_length, CTX.arrow_rel_stem_radius,
x, y, z, der[0], der[1], der[2], CTX.geom.light); x, y, z, der[0], der[1], der[2], CTX.geom.light);
...@@ -294,7 +294,7 @@ class drawGFace { ...@@ -294,7 +294,7 @@ class drawGFace {
glColor4ubv((GLubyte *) & CTX.color.geom.normals); glColor4ubv((GLubyte *) & CTX.color.geom.normals);
double x = p.x(), y = p.y(), z = p.z(); double x = p.x(), y = p.y(), z = p.z();
_ctx->transform(x, y, z); _ctx->transform(x, y, z);
// FIXME: transform the normal _ctx->transformTwoForm(n[0], n[1], n[2]);
_ctx->drawVector(CTX.vector_type, 0, CTX.arrow_rel_head_radius, _ctx->drawVector(CTX.vector_type, 0, CTX.arrow_rel_head_radius,
CTX.arrow_rel_stem_length, CTX.arrow_rel_stem_radius, CTX.arrow_rel_stem_length, CTX.arrow_rel_stem_radius,
x, y, z, n[0], n[1], n[2], CTX.geom.light); x, y, z, n[0], n[1], n[2], CTX.geom.light);
...@@ -364,7 +364,7 @@ class drawGFace { ...@@ -364,7 +364,7 @@ class drawGFace {
glColor4ubv((GLubyte *) & CTX.color.geom.normals); glColor4ubv((GLubyte *) & CTX.color.geom.normals);
double x = p.x(), y = p.y(), z = p.z(); double x = p.x(), y = p.y(), z = p.z();
_ctx->transform(x, y, z); _ctx->transform(x, y, z);
// FIXME: transform the normal _ctx->transformTwoForm(n[0], n[1], n[2]);
_ctx->drawVector(CTX.vector_type, 0, CTX.arrow_rel_head_radius, _ctx->drawVector(CTX.vector_type, 0, CTX.arrow_rel_head_radius,
CTX.arrow_rel_stem_length, CTX.arrow_rel_stem_radius, CTX.arrow_rel_stem_length, CTX.arrow_rel_stem_radius,
x, y, z, n[0], n[1], n[2], CTX.geom.light); x, y, z, n[0], n[1], n[2], CTX.geom.light);
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <functional> #include <functional>
#include <list> #include <list>
#include <math.h> #include <math.h>
#include "GFace.h"
#include "PView.h"
#include "GmshMessage.h" #include "GmshMessage.h"
class BDS_Edge; class BDS_Edge;
...@@ -135,11 +133,8 @@ public: ...@@ -135,11 +133,8 @@ public:
return (x * v.x + y * v.y + z * v.z); return (x * v.x + y * v.y + z * v.z);
} }
BDS_Vector(const BDS_Point &p2, const BDS_Point &p1); BDS_Vector(const BDS_Point &p2, const BDS_Point &p1);
BDS_Vector(const double X=0., const double Y=0., const double Z=0.) BDS_Vector(const double X=0., const double Y=0., const double Z=0.)
: x(X), y(Y), z(Z) : x(X), y(Y), z(Z) {}
{
}
static double t; static double t;
}; };
...@@ -178,9 +173,7 @@ public: ...@@ -178,9 +173,7 @@ public:
void getTriangles(std::list<BDS_Face *> &t) const; void getTriangles(std::list<BDS_Face *> &t) const;
BDS_Point(int id, double x=0, double y=0, double z=0) BDS_Point(int id, double x=0, double y=0, double z=0)
: _lcBGM(1.e22), _lcPTS(1.e22), X(x), Y(y), Z(z), u(0), v(0), : _lcBGM(1.e22), _lcPTS(1.e22), X(x), Y(y), Z(z), u(0), v(0),
config_modified(true), iD(id), g(0) config_modified(true), iD(id), g(0) {}
{
}
}; };
class BDS_Edge class BDS_Edge
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "meshGFaceQuadrilateralize.h" #include "meshGFaceQuadrilateralize.h"
#include "GmshMessage.h" #include "GmshMessage.h"
#include "Numeric.h" #include "Numeric.h"
#include "GFace.h"
#include "meshGFaceDelaunayInsertion.h" #include "meshGFaceDelaunayInsertion.h"
#include "meshGFaceOptimize.h" #include "meshGFaceOptimize.h"
#include "meshGFaceBDS.h" #include "meshGFaceBDS.h"
......
...@@ -95,7 +95,6 @@ PView *GMSH_ExtractEdgesPlugin::execute(PView *v) ...@@ -95,7 +95,6 @@ PView *GMSH_ExtractEdgesPlugin::execute(PView *v)
++it; ++it;
} }
data2->setName(data1->getName() + "_ExtractEdges"); data2->setName(data1->getName() + "_ExtractEdges");
data2->setFileName(data1->getName() + "_ExtractEdges.pos"); data2->setFileName(data1->getName() + "_ExtractEdges.pos");
data2->finalize(); data2->finalize();
......
This diff is collapsed.
...@@ -19,11 +19,9 @@ class adaptivePoint { ...@@ -19,11 +19,9 @@ class adaptivePoint {
public: public:
double x, y, z, X, Y, Z; double x, y, z, X, Y, Z;
double val, valx, valy, valz; double val, valx, valy, valz;
double shapeFunctions[128];
static std::set<adaptivePoint> all;
public: public:
static adaptivePoint *create(double x, double y, double z, static adaptivePoint *add(double x, double y, double z,
Double_Matrix *coeffs, Double_Matrix *eexps); std::set<adaptivePoint> &allPoints);
bool operator < (const adaptivePoint &other) const bool operator < (const adaptivePoint &other) const
{ {
if(other.x < x) return true; if(other.x < x) return true;
...@@ -41,6 +39,7 @@ class adaptiveLine { ...@@ -41,6 +39,7 @@ class adaptiveLine {
adaptivePoint *p[2]; adaptivePoint *p[2];
adaptiveLine *e[2]; adaptiveLine *e[2];
static std::list<adaptiveLine*> all; static std::list<adaptiveLine*> all;
static std::set<adaptivePoint> allPoints;
static int numNodes, numEdges; static int numNodes, numEdges;
public: public:
adaptiveLine(adaptivePoint *p1, adaptivePoint *p2) adaptiveLine(adaptivePoint *p1, adaptivePoint *p2)
...@@ -59,9 +58,8 @@ class adaptiveLine { ...@@ -59,9 +58,8 @@ class adaptiveLine {
sf[0] = (1 - u) / 2.; sf[0] = (1 - u) / 2.;
sf[1] = (1 + u) / 2.; sf[1] = (1 + u) / 2.;
} }
static void create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps); static void create(int maxlevel);
static void recurCreate(adaptiveLine *e, int maxlevel, int level, static void recurCreate(adaptiveLine *e, int maxlevel, int level);
Double_Matrix *coeffs, Double_Matrix *eexps);
static void error(double AVG, double tol); static void error(double AVG, double tol);
static void recurError(adaptiveLine *e, double AVG, double tol); static void recurError(adaptiveLine *e, double AVG, double tol);
}; };
...@@ -72,6 +70,7 @@ class adaptiveTriangle { ...@@ -72,6 +70,7 @@ class adaptiveTriangle {
adaptivePoint *p[3]; adaptivePoint *p[3];
adaptiveTriangle *e[4]; adaptiveTriangle *e[4];
static std::list<adaptiveTriangle*> all; static std::list<adaptiveTriangle*> all;
static std::set<adaptivePoint> allPoints;
static int numNodes, numEdges; static int numNodes, numEdges;
public: public:
adaptiveTriangle(adaptivePoint *p1, adaptivePoint *p2, adaptivePoint *p3) adaptiveTriangle(adaptivePoint *p1, adaptivePoint *p2, adaptivePoint *p3)
...@@ -92,9 +91,8 @@ class adaptiveTriangle { ...@@ -92,9 +91,8 @@ class adaptiveTriangle {
sf[1] = u; sf[1] = u;
sf[2] = v; sf[2] = v;
} }
static void create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps); static void create(int maxlevel);
static void recurCreate(adaptiveTriangle *t, int maxlevel, int level, static void recurCreate(adaptiveTriangle *t, int maxlevel, int level);
Double_Matrix *coeffs, Double_Matrix *eexps);
static void error(double AVG, double tol); static void error(double AVG, double tol);
static void recurError(adaptiveTriangle *t, double AVG, double tol); static void recurError(adaptiveTriangle *t, double AVG, double tol);
}; };
...@@ -105,6 +103,7 @@ class adaptiveQuadrangle { ...@@ -105,6 +103,7 @@ class adaptiveQuadrangle {
adaptivePoint *p[4]; adaptivePoint *p[4];
adaptiveQuadrangle *e[4]; adaptiveQuadrangle *e[4];
static std::list<adaptiveQuadrangle*> all; static std::list<adaptiveQuadrangle*> all;
static std::set<adaptivePoint> allPoints;
static int numNodes, numEdges; static int numNodes, numEdges;
public: public:
adaptiveQuadrangle(adaptivePoint *p1, adaptivePoint *p2, adaptiveQuadrangle(adaptivePoint *p1, adaptivePoint *p2,
...@@ -128,9 +127,8 @@ class adaptiveQuadrangle { ...@@ -128,9 +127,8 @@ class adaptiveQuadrangle {
sf[2] = 0.25 * (1. + u) * (1. + v); sf[2] = 0.25 * (1. + u) * (1. + v);
sf[3] = 0.25 * (1. - u) * (1. + v); sf[3] = 0.25 * (1. - u) * (1. + v);
} }
static void create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps); static void create(int maxlevel);
static void recurCreate(adaptiveQuadrangle *q, int maxlevel, int level, static void recurCreate(adaptiveQuadrangle *q, int maxlevel, int level);
Double_Matrix *coeffs, Double_Matrix *eexps);
static void error(double AVG, double tol); static void error(double AVG, double tol);
static void recurError(adaptiveQuadrangle *q, double AVG, double tol); static void recurError(adaptiveQuadrangle *q, double AVG, double tol);
}; };
...@@ -141,6 +139,7 @@ class adaptivePrism { ...@@ -141,6 +139,7 @@ class adaptivePrism {
adaptivePoint *p[6]; adaptivePoint *p[6];
adaptivePrism *e[12]; adaptivePrism *e[12];
static std::list<adaptivePrism*> all; static std::list<adaptivePrism*> all;
static std::set<adaptivePoint> allPoints;
static int numNodes, numEdges; static int numNodes, numEdges;
public: public:
adaptivePrism(adaptivePoint *p1, adaptivePoint *p2, adaptivePrism(adaptivePoint *p1, adaptivePoint *p2,
...@@ -171,9 +170,8 @@ class adaptivePrism { ...@@ -171,9 +170,8 @@ class adaptivePrism {
sf[4] = u*(1+w)/2; sf[4] = u*(1+w)/2;
sf[5] = v*(1+w)/2; sf[5] = v*(1+w)/2;
} }
static void create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps); static void create(int maxlevel);
static void recurCreate(adaptivePrism *p, int maxlevel, int level, static void recurCreate(adaptivePrism *p, int maxlevel, int level);
Double_Matrix *coeffs, Double_Matrix *eexps);
static void error(double AVG, double tol); static void error(double AVG, double tol);
static void recurError(adaptivePrism *p, double AVG, double tol); static void recurError(adaptivePrism *p, double AVG, double tol);
}; };
...@@ -184,6 +182,7 @@ class adaptiveTetrahedron { ...@@ -184,6 +182,7 @@ class adaptiveTetrahedron {
adaptivePoint *p[4]; adaptivePoint *p[4];
adaptiveTetrahedron *e[8]; adaptiveTetrahedron *e[8];
static std::list<adaptiveTetrahedron*> all; static std::list<adaptiveTetrahedron*> all;
static std::set<adaptivePoint> allPoints;
static int numNodes, numEdges; static int numNodes, numEdges;
public: public:
adaptiveTetrahedron(adaptivePoint *p1, adaptivePoint *p2, adaptiveTetrahedron(adaptivePoint *p1, adaptivePoint *p2,
...@@ -208,9 +207,8 @@ class adaptiveTetrahedron { ...@@ -208,9 +207,8 @@ class adaptiveTetrahedron {
sf[2] = v; sf[2] = v;
sf[3] = w; sf[3] = w;
} }
static void create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps); static void create(int maxlevel);
static void recurCreate(adaptiveTetrahedron *t, int maxlevel, int level, static void recurCreate(adaptiveTetrahedron *t, int maxlevel, int level);
Double_Matrix *coeffs, Double_Matrix *eexps);
static void error(double AVG, double tol); static void error(double AVG, double tol);
static void recurError(adaptiveTetrahedron *t, double AVG, double tol); static void recurError(adaptiveTetrahedron *t, double AVG, double tol);
}; };
...@@ -221,6 +219,7 @@ class adaptiveHexahedron { ...@@ -221,6 +219,7 @@ class adaptiveHexahedron {
adaptivePoint *p[8]; adaptivePoint *p[8];
adaptiveHexahedron *e[8]; adaptiveHexahedron *e[8];
static std::list<adaptiveHexahedron*> all; static std::list<adaptiveHexahedron*> all;
static std::set<adaptivePoint> allPoints;
static int numNodes, numEdges; static int numNodes, numEdges;
public: public:
adaptiveHexahedron(adaptivePoint *p1, adaptivePoint *p2, adaptivePoint *p3, adaptiveHexahedron(adaptivePoint *p1, adaptivePoint *p2, adaptivePoint *p3,
...@@ -255,9 +254,8 @@ class adaptiveHexahedron { ...@@ -255,9 +254,8 @@ class adaptiveHexahedron {
sf[6] = 0.125 * (1 + u) * (1 + v) * (1 + w); sf[6] = 0.125 * (1 + u) * (1 + v) * (1 + w);
sf[7] = 0.125 * (1 - u) * (1 + v) * (1 + w); sf[7] = 0.125 * (1 - u) * (1 + v) * (1 + w);
} }
static void create(int maxlevel, Double_Matrix *coeffs, Double_Matrix *eexps); static void create(int maxlevel);
static void recurCreate(adaptiveHexahedron *h, int maxlevel, int level, static void recurCreate(adaptiveHexahedron *h, int maxlevel, int level);
Double_Matrix *coeffs, Double_Matrix *eexps);
static void error(double AVG, double tol); static void error(double AVG, double tol);
static void recurError(adaptiveHexahedron *h, double AVG, double tol); static void recurError(adaptiveHexahedron *h, double AVG, double tol);
}; };
......
...@@ -67,7 +67,6 @@ View "Primitives"{ ...@@ -67,7 +67,6 @@ View "Primitives"{
}; };
Alias View[0]; Alias View[0];
View[1].Name = "Primitives (dupl. 1)" ;
View[1].OffsetX = 3 ; View[1].OffsetX = 3 ;
View[1].IntervalsType = 2 ; View[1].IntervalsType = 2 ;
View[1].ShowElement = 1 ; View[1].ShowElement = 1 ;
...@@ -75,7 +74,6 @@ View[1].GlyphLocation = 2 ; ...@@ -75,7 +74,6 @@ View[1].GlyphLocation = 2 ;
View[1].ColorTable = {Red,Green,Magenta,Cyan,Brown,Pink} ; View[1].ColorTable = {Red,Green,Magenta,Cyan,Brown,Pink} ;
Alias View[0]; Alias View[0];
View[2].Name = "Primitives (dupl. 2)" ;
View[2].OffsetX = 6 ; View[2].OffsetX = 6 ;
View[2].IntervalsType = 4 ; View[2].IntervalsType = 4 ;
View[2].ShowElement = 1 ; View[2].ShowElement = 1 ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment