diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp index 28d91e5e5b226c450b2d5cc2e7f5ce5c5709ec4f..c7cc2cb2084e91d23924f24cb29fb2e98226f349 100644 --- a/Mesh/meshGEdge.cpp +++ b/Mesh/meshGEdge.cpp @@ -52,31 +52,35 @@ double F_Transfini_bis(double t) switch (abs(type)) { case 1: // Geometric progression ar^i; Sum of n terms = THEC->l = a (r^n-1)/(r-1) - if(sign(type) >= 0) - r = coef; - else - r = 1. / coef; - double a = _myGEdgeLength * (r - 1.) / (pow(r, nbpt - 1.) - 1.); - int i = (int)(log(t * _myGEdgeLength / a * (r - 1.) + 1.) / log(r)); - val = d / (a * pow(r, (double)i)); + { + if(sign(type) >= 0) + r = coef; + else + r = 1. / coef; + double a = _myGEdgeLength * (r - 1.) / (pow(r, nbpt - 1.) - 1.); + int i = (int)(log(t * _myGEdgeLength / a * (r - 1.) + 1.) / log(r)); + val = d / (a * pow(r, (double)i)); + } break; - + case 2: // Bump - if(coef > 1.0) { - a = -4. * sqrt(coef - 1.) * - atan2(1., sqrt(coef - 1.)) / - ((double)nbpt * _myGEdgeLength); + { + if(coef > 1.0) { + a = -4. * sqrt(coef - 1.) * + atan2(1., sqrt(coef - 1.)) / + ((double)nbpt * _myGEdgeLength); + } + else { + a = 2. * sqrt(1. - coef) * + log(fabs((1. + 1. / sqrt(1. - coef)) + / (1. - 1. / sqrt(1. - coef)))) + / ((double)nbpt * _myGEdgeLength); + } + double b = -a * _myGEdgeLength * _myGEdgeLength / (4. * (coef - 1.)); + val = d / (-a * DSQR(t * _myGEdgeLength - (_myGEdgeLength) * 0.5) + b); } - else { - a = 2. * sqrt(1. - coef) * - log(fabs((1. + 1. / sqrt(1. - coef)) - / (1. - 1. / sqrt(1. - coef)))) - / ((double)nbpt * _myGEdgeLength); - } - double b = -a * _myGEdgeLength * _myGEdgeLength / (4. * (coef - 1.)); - val = d / (-a * DSQR(t * _myGEdgeLength - (_myGEdgeLength) * 0.5) + b); break; - + default: Msg(WARNING, "Unknown case in Transfinite Line mesh"); val = 1.; diff --git a/Mesh/meshGEdge.h b/Mesh/meshGEdge.h new file mode 100644 index 0000000000000000000000000000000000000000..2efedcadf5483ca6d90b6c48d4274569d4bfaedb --- /dev/null +++ b/Mesh/meshGEdge.h @@ -0,0 +1,19 @@ +#ifndef _MESH_GEDGE_H_ +#define _MESH_GEDGE_H_ + +class GEdge; +// Create the mesh of the edge +class meshGEdge +{ + public : + void operator () ( GEdge * ); +}; + +// destroy the mesh of the edge +class deMeshGEdge +{ + public : + void operator () ( GEdge * ); +}; + +#endif diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index 7151bfe6b3ebb72b7332b62fdcfa1c5adf329262..c5ec6b70d447f1f1e5c09e6cbd07794c4e968fc8 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.95 2006-07-10 12:16:35 remacle Exp $ +// $Id: OpenFile.cpp,v 1.96 2006-07-11 13:41:22 remacle Exp $ // // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // @@ -49,6 +49,7 @@ void UpdateViewsInGUI(); #endif extern Mesh *THEM, M; +extern GModel *GMODEL; extern Context_T CTX; extern void BDS_To_Mesh(Mesh *m); @@ -351,7 +352,7 @@ int MergeProblem(char *name, int warn_if_missing) } else { status = ParseFile(name, 0, 1); - gmshModel m ; + GMODEL = new gmshModel ; } }