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

don't use internal GEO data in the field

parent 773b9d8b
No related branches found
No related tags found
No related merge requests found
......@@ -19,15 +19,16 @@
#include "GmshConfig.h"
#include "Context.h"
#include "Field.h"
#include "Geo.h"
#include "GeoInterpolation.h"
#include "GModel.h"
#include "GModelIO_GEO.h"
#include "GmshMessage.h"
#include "Numeric.h"
#include "mathEvaluator.h"
#include "BackgroundMeshTools.h"
#include "STensor3.h"
#include "meshMetric.h"
#include "ExtrudeParams.h"
#if defined(HAVE_POST)
#include "PView.h"
#include "OctreePost.h"
......@@ -1858,6 +1859,8 @@ class AttractorAnisoCurveField : public Field {
(lMinNormal, "Minimum mesh size in the direction normal to the closest curve.");
options["lMaxNormal"] = new FieldOptionDouble
(lMaxNormal, "Maximum mesh size in the direction normal to the closest curve.");
// make sure all internal GEO CAD data has been synced with GModel
GModel::current()->getGEOInternals()->synchronize(GModel::current());
}
virtual bool isotropic () const {return false;}
~AttractorAnisoCurveField()
......@@ -1893,38 +1896,22 @@ class AttractorAnisoCurveField : public Field {
int k = 0;
for(std::list<int>::iterator it = edges_id.begin();
it != edges_id.end(); ++it) {
Curve *c = FindCurve(*it);
if(c) {
GEdge *e = GModel::current()->getEdgeByTag(*it);
if(e) {
for(int i = 1; i < n_nodes_by_edge - 1; i++) {
double u = (double)i / (n_nodes_by_edge - 1);
Vertex V = InterpolateCurve(c, u, 0);
zeronodes[k][0] = V.Pos.X;
zeronodes[k][1] = V.Pos.Y;
zeronodes[k][2] = V.Pos.Z;
Vertex V2 = InterpolateCurve(c, u, 1);
tg[k] = SVector3(V2.Pos.X, V2.Pos.Y, V2.Pos.Z);
Range<double> b = e->parBounds(0);
double t = b.low() + u * (b.high() - b.low());
GPoint gp = e->point(t);
SVector3 d = e->firstDer(t);
zeronodes[k][0] = gp.x();
zeronodes[k][1] = gp.y();
zeronodes[k][2] = gp.z();
tg[k] = d;
tg[k].normalize();
k++;
}
}
else {
GEdge *e = GModel::current()->getEdgeByTag(*it);
if(e) {
for(int i = 1; i < n_nodes_by_edge - 1; i++) {
double u = (double)i / (n_nodes_by_edge - 1);
Range<double> b = e->parBounds(0);
double t = b.low() + u * (b.high() - b.low());
GPoint gp = e->point(t);
SVector3 d = e->firstDer(t);
zeronodes[k][0] = gp.x();
zeronodes[k][1] = gp.y();
zeronodes[k][2] = gp.z();
tg[k] = d;
tg[k].normalize();
k++;
}
}
}
}
kdtree = new ANNkd_tree(zeronodes, totpoints, 3);
update_needed = false;
......
......@@ -104,7 +104,7 @@ PView *GMSH_FaultZonePlugin::execute(PView *view)
return view;
}
std::list< GEdge* > embeddedEdges = gFace->embeddedEdges();
std::list<GEdge*> embeddedEdges = gFace->embeddedEdges();
std::list<GEdge*>::const_iterator itl;
for(itl = embeddedEdges.begin();itl != embeddedEdges.end(); ++itl)
if ((*itl)->length() != 0) break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment