diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp index 77fcf8961e2d1e370f0b8785e3cc9613fda5144b..2759e77a912119761b4c0b5a621e23aba9687cd5 100644 --- a/Geo/GEdge.cpp +++ b/Geo/GEdge.cpp @@ -12,13 +12,8 @@ #include "GEdge.h" #include "GFace.h" #include "MLine.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "GaussLegendre1D.h" #include "Context.h" -#endif GEdge::GEdge(GModel *model, int tag, GVertex *_v0, GVertex *_v1) : GEntity(model, tag), _tooSmall(false), v0(_v0), v1(_v1), compound(0) @@ -220,9 +215,6 @@ double GEdge::curvature(double par) const double GEdge::length(const double &u0, const double &u1, const int nbQuadPoints) { -#if defined(HAVE_GMSH_EMBEDDED) - return -1.; -#else double *t = 0, *w = 0; gmshGaussLegendre1D(nbQuadPoints, &t, &w); double L = 0.0; @@ -234,7 +226,6 @@ double GEdge::length(const double &u0, const double &u1, const int nbQuadPoints) L += d * w[i] * rapJ; } return L; -#endif } GPoint GEdge::closestPoint(const SPoint3 &q, double &t) const diff --git a/Geo/GEntity.cpp b/Geo/GEntity.cpp index 97cbbd215948ec2ca3acc32b45213ab067efdaad..2fbcdd892626c3a1414933cc9caeeb2cc1f59ae3 100644 --- a/Geo/GEntity.cpp +++ b/Geo/GEntity.cpp @@ -8,12 +8,7 @@ #include "GEntity.h" #include "MElement.h" #include "VertexArray.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "Context.h" -#endif GEntity::GEntity(GModel *m, int t) : _model(m), _tag(t), _visible(1), _selection(0), diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index 8695f841cf2d887c3ebcf6005c38d471592a62b8..2bd17785cdc1cd289971feee23cd9ff7c617eb6a 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -16,14 +16,8 @@ #include "GmshMatrix.h" #include "Numeric.h" #include "EigSolve.h" - - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "GaussLegendre1D.h" #include "Context.h" -#endif #define SQU(a) ((a)*(a)) @@ -868,9 +862,6 @@ struct graphics_point{ bool GFace::buildSTLTriangulation() { -#if defined(HAVE_GMSH_EMBEDDED) - return false; -#else // Build a simple triangulation for surfaces which we know are not // trimmed if(geomType() != ParametricSurface && geomType() != ProjectionFace) @@ -920,7 +911,6 @@ bool GFace::buildSTLTriangulation() } va_geom_triangles->finalize(); return true; -#endif } // by default we assume that straight lines are geodesics @@ -954,9 +944,6 @@ SPoint2 GFace::geodesic(const SPoint2 &pt1 , const SPoint2 &pt2 , double t) // dC/dt = dC/du du/dt + dC/dv dv/dt double GFace::length(const SPoint2 &pt1, const SPoint2 &pt2, int nbQuadPoints) { -#if defined(HAVE_GMSH_EMBEDDED) - return -1.; -#else double *t = 0, *w = 0; double L = 0.0; gmshGaussLegendre1D(nbQuadPoints, &t, &w); @@ -969,5 +956,4 @@ double GFace::length(const SPoint2 &pt1, const SPoint2 &pt2, int nbQuadPoints) L += d * w[i] ; } return L; -#endif } diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index c44c79949e111e07e5b9a4352d5623dc2d7c8653..230265837eb655c94b7a3ffbc9d03ee074d381f2 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -20,17 +20,12 @@ #include "discreteFace.h" #include "discreteEdge.h" #include "discreteVertex.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "gmshSurface.h" #include "Octree.h" #include "SmoothData.h" #include "Field.h" #include "Generator.h" #include "Context.h" -#endif std::vector<GModel*> GModel::list; int GModel::_current = -1; @@ -42,26 +37,19 @@ GModel::GModel(std::string name) { partitionSize[0] = 0; partitionSize[1] = 0; list.push_back(this); - -#if !defined(HAVE_GMSH_EMBEDDED) // at the moment we always create (at least an empty) GEO model _createGEOInternals(); _fields = new FieldManager(); -#endif } GModel::~GModel() { std::vector<GModel*>::iterator it = std::find(list.begin(), list.end(), this); if(it != list.end()) list.erase(it); - destroy(); - -#if !defined(HAVE_GMSH_EMBEDDED) _deleteGEOInternals(); _deleteOCCInternals(); delete _fields; -#endif } GModel *GModel::current(int index) @@ -116,23 +104,19 @@ void GModel::destroy() MVertex::resetGlobalNumber(); MElement::resetGlobalNumber(); -#if !defined(HAVE_GMSH_EMBEDDED) if(normals) delete normals; normals = 0; _fields->reset(); gmshSurface::reset(); -#endif } void GModel::destroyMeshCaches() { _vertexVectorCache.clear(); _vertexMapCache.clear(); -#if !defined(HAVE_GMSH_EMBEDDED) if(_octree) Octree_Delete(_octree); _octree = 0; -#endif } bool GModel::empty() const @@ -359,13 +343,8 @@ SBoundingBox3d GModel::bounds() int GModel::mesh(int dimension) { -#if !defined(HAVE_GMSH_EMBEDDED) GenerateMesh(this, dimension); return true; -#else - Msg::Error("Embedded Gmsh cannot do mesh generation"); - return false; -#endif } int GModel::getMeshStatus(bool countDiscrete) @@ -464,7 +443,6 @@ static int MElementInEle(void *a, double *x) MElement *GModel::getMeshElementByCoord(SPoint3 &p) { -#if !defined(HAVE_GMSH_EMBEDDED) if(!_octree){ Msg::Debug("Rebuilding mesh element octree"); SBoundingBox3d bb = bounds(); @@ -484,10 +462,6 @@ MElement *GModel::getMeshElementByCoord(SPoint3 &p) } double P[3] = {p.x(), p.y(), p.z()}; return (MElement*)Octree_Search(P, _octree); -#else - Msg::Error("Embedded Gmsh cannot perform octree-based element searches"); - return 0; -#endif } MVertex *GModel::getMeshVertexByTag(int n) diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp index 7dc404b1d39c8e520018cd7663a279e6ee40e0e1..eac5db8f1870959781e6b9b7f0bdb4cef00255c9 100644 --- a/Geo/MElement.cpp +++ b/Geo/MElement.cpp @@ -21,12 +21,7 @@ #include "GFace.h" #include "StringUtils.h" #include "Numeric.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "Context.h" -#endif #define SQU(a) ((a)*(a)) @@ -100,20 +95,16 @@ double MElement::rhoShapeMeasure() void MElement::getShapeFunctions(double u, double v, double w, double s[], int o) { -#if !defined(HAVE_GMSH_EMBEDDED) const gmshFunctionSpace* fs = getFunctionSpace(o); if(fs) fs->f(u, v, w, s); else Msg::Error("Function space not implemented for this type of element"); -#endif } void MElement::getGradShapeFunctions(double u, double v, double w, double s[][3], int o) { -#if !defined(HAVE_GMSH_EMBEDDED) const gmshFunctionSpace* fs = getFunctionSpace(o); if(fs) fs->df(u, v, w, s); else Msg::Error("Function space not implemented for this type of element"); -#endif } SPoint3 MElement::barycenter() diff --git a/Geo/MFace.cpp b/Geo/MFace.cpp index 717ef31586e9a4426f536f0c32016d618a6cd852..617e09c5e426acde99045e80a848641ac96a0be5 100644 --- a/Geo/MFace.cpp +++ b/Geo/MFace.cpp @@ -8,12 +8,7 @@ #include "GmshConfig.h" #include "MFace.h" #include "Numeric.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "Context.h" -#endif void sortVertices(std::vector<MVertex*> v, std::vector<char> &si) { diff --git a/Geo/MHexahedron.cpp b/Geo/MHexahedron.cpp index 20ccc3916213888e046c9769f87dbe51b9c9a63e..f7bbf706dcd667175a378421c114d5032da391fd 100644 --- a/Geo/MHexahedron.cpp +++ b/Geo/MHexahedron.cpp @@ -23,8 +23,6 @@ int MHexahedron::getVolumeSign() void MHexahedron::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const { -#if !defined(HAVE_GMSH_EMBEDDED) *npts = getNGQHPts(pOrder); *pts = getGQHPts(pOrder); -#endif } diff --git a/Geo/MLine.cpp b/Geo/MLine.cpp index e5205a683889313c4da160ecc268f7740e59e20a..96a32cd12bb84aee11f2f800f428a6824ca1d56c 100644 --- a/Geo/MLine.cpp +++ b/Geo/MLine.cpp @@ -4,14 +4,9 @@ // bugs and problems to <gmsh@geuz.org>. #include "MLine.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "GaussLegendre1D.h" #include "Context.h" #include "qualityMeasures.h" -#endif const gmshFunctionSpace* MLine::getFunctionSpace(int o) const { @@ -30,7 +25,6 @@ const gmshFunctionSpace* MLine::getFunctionSpace(int o) const void MLine::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const { -#if !defined(HAVE_GMSH_EMBEDDED) static IntPt GQL[100]; double *t, *w; int nbP = pOrder / 2 + 1; @@ -43,5 +37,4 @@ void MLine::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const } *npts = nbP; *pts = GQL; -#endif } diff --git a/Geo/MQuadrangle.cpp b/Geo/MQuadrangle.cpp index 3f99a8c547fe63593a172abb80e0c16758c4e8a1..9c689220bcfc8b58a0d2b56059a9d46151423a9b 100644 --- a/Geo/MQuadrangle.cpp +++ b/Geo/MQuadrangle.cpp @@ -4,20 +4,13 @@ // bugs and problems to <gmsh@geuz.org>. #include "MQuadrangle.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "GaussLegendre1D.h" #include "Context.h" #include "qualityMeasures.h" -#endif void MQuadrangle::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const { -#if !defined(HAVE_GMSH_EMBEDDED) *npts = getNGQQPts(pOrder); *pts = getGQQPts(pOrder); -#endif } diff --git a/Geo/MTetrahedron.cpp b/Geo/MTetrahedron.cpp index 26b3a708d8a003a7d424d9bf12d0a3de106c6264..efc4d8d6eb2ea172a722d4d204e1c6e2f6f4d96e 100644 --- a/Geo/MTetrahedron.cpp +++ b/Geo/MTetrahedron.cpp @@ -5,68 +5,42 @@ #include "MTetrahedron.h" #include "Numeric.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "Context.h" #include "qualityMeasures.h" #include "meshGFaceDelaunayInsertion.h" #include "meshGRegionDelaunayInsertion.h" -#endif #define SQU(a) ((a)*(a)) SPoint3 MTetrahedron::circumcenter() { -#if defined(HAVE_GMSH_EMBEDDED) - return SPoint3(); -#else MTet4 t(this,0); double res[3]; t.circumcenter(res); return SPoint3(res[0],res[1],res[2]); -#endif } double MTetrahedron::distoShapeMeasure() { -#if defined(HAVE_GMSH_EMBEDDED) - return 1.; -#else return qmDistorsionOfMapping(this); -#endif } double MTetrahedronN::distoShapeMeasure() { -#if defined(HAVE_GMSH_EMBEDDED) - return 1.; -#else - // if (_disto < -1.e21) _disto = qmDistorsionOfMapping(this); return _disto; -#endif } double MTetrahedron::gammaShapeMeasure() { -#if defined(HAVE_GMSH_EMBEDDED) - return 0.; -#else double vol; return qmTet(this, QMTET_2, &vol); -#endif } double MTetrahedron::etaShapeMeasure() { -#if defined(HAVE_GMSH_EMBEDDED) - return 0.; -#else double vol; return qmTet(this, QMTET_3, &vol); -#endif } double MTetrahedron::getVolume() @@ -254,8 +228,6 @@ void MTetrahedron10::getFaceRep(int num, double *x, double *y, double *z, SVecto void MTetrahedron::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const { -#if !defined(HAVE_GMSH_EMBEDDED) *npts = getNGQTetPts(pOrder); *pts = getGQTetPts(pOrder); -#endif } diff --git a/Geo/MTriangle.cpp b/Geo/MTriangle.cpp index c334469365c3790e86ba2635004d49ddad5993aa..a7331ce42905880eae83beade1f4a92b8dac24af 100644 --- a/Geo/MTriangle.cpp +++ b/Geo/MTriangle.cpp @@ -5,46 +5,29 @@ #include "MTriangle.h" #include "Numeric.h" - -#if defined(HAVE_GMSH_EMBEDDED) -#include "GmshEmbedded.h" -#else #include "Context.h" #include "qualityMeasures.h" -#endif #define SQU(a) ((a)*(a)) SPoint3 MTriangle::circumcenter() { -#if defined(HAVE_GMSH_EMBEDDED) - return SPoint3(); -#else double p1[3] = {_v[0]->x(), _v[0]->y(), _v[0]->z()}; double p2[3] = {_v[1]->x(), _v[1]->y(), _v[1]->z()}; double p3[3] = {_v[2]->x(), _v[2]->y(), _v[2]->z()}; double res[3]; circumCenterXYZ(p1, p2, p3, res); return SPoint3(res[0], res[1], res[2]); -#endif } double MTriangle::distoShapeMeasure() { -#if defined(HAVE_GMSH_EMBEDDED) - return 1.; -#else return qmDistorsionOfMapping(this); -#endif } double MTriangle::gammaShapeMeasure() { -#if defined(HAVE_GMSH_EMBEDDED) - return 0.; -#else return qmTriangle(this, QMTRI_RHO); -#endif } const gmshFunctionSpace* MTriangle::getFunctionSpace(int o) const @@ -201,9 +184,7 @@ void MTriangle6::getFaceRep(int num, double *x, double *y, double *z, SVector3 * void MTriangle::getIntegrationPoints(int pOrder, int *npts, IntPt **pts) const { -#if !defined(HAVE_GMSH_EMBEDDED) *npts = getNGQTPts(pOrder); *pts = getGQTPts(pOrder); -#endif } diff --git a/Geo/discreteEdge.cpp b/Geo/discreteEdge.cpp index 9e33a280affe14052a059f96cd396aac8a0d4247..4eb5cc5c7d95ea187fc4cc3c84933ace94612ec0 100644 --- a/Geo/discreteEdge.cpp +++ b/Geo/discreteEdge.cpp @@ -3,6 +3,8 @@ // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. +#include <vector> +#include <list> #include "GmshConfig.h" #include "GmshMessage.h" #include "discreteEdge.h" @@ -15,36 +17,26 @@ #include "MTetrahedron.h" #include "MHexahedron.h" #include "MPyramid.h" - - -#include <vector> -#include <list> - -#if !defined(HAVE_GMSH_EMBEDDED) #include "Geo.h" -#endif discreteEdge::discreteEdge(GModel *model, int num, GVertex *_v0, GVertex *_v1) : GEdge(model, num, _v0, _v1) { createdTopo = false; -#if !defined(HAVE_GMSH_EMBEDDED) Curve *c = Create_Curve(num, MSH_SEGM_DISCRETE, 0, 0, 0, -1, -1, 0., 1.); Tree_Add(model->getGEOInternals()->Curves, &c); CreateReversedCurve(c); -#endif } void discreteEdge::createTopo() { - if(!createdTopo){ orderMLines(); setBoundVertices(); createdTopo = true; } - } + void discreteEdge::orderMLines() { //printf(" *** ORDERING DISCRETE EDGE %d of size %d \n", this->tag(), lines.size()); diff --git a/Geo/discreteFace.cpp b/Geo/discreteFace.cpp index 486330b46a576593db92220efe572d69cd5b03da..eed2ff0d3826e00c0fce623bb936e8414ed17289 100644 --- a/Geo/discreteFace.cpp +++ b/Geo/discreteFace.cpp @@ -8,17 +8,12 @@ #include "discreteFace.h" #include "MTriangle.h" #include "MEdge.h" - -#if !defined(HAVE_GMSH_EMBEDDED) #include "Geo.h" -#endif discreteFace::discreteFace(GModel *model, int num) : GFace(model, num) { -#if !defined(HAVE_GMSH_EMBEDDED) Surface *s = Create_Surface(num, MSH_SURF_DISCRETE); Tree_Add(model->getGEOInternals()->Surfaces, &s); -#endif meshStatistics.status = GFace::DONE; } diff --git a/Geo/discreteRegion.cpp b/Geo/discreteRegion.cpp index db7aefa3ce23468b52ba7ab147aae0e3e25a16e0..91bddb96a2129e2c8b5276eede1e2cedf1cc16e7 100644 --- a/Geo/discreteRegion.cpp +++ b/Geo/discreteRegion.cpp @@ -6,22 +6,16 @@ #include "GmshConfig.h" #include "discreteRegion.h" #include "MVertex.h" - -#if !defined(HAVE_GMSH_EMBEDDED) #include "Geo.h" -#endif discreteRegion::discreteRegion(GModel *model, int num) : GRegion(model, num) { -#if !defined(HAVE_GMSH_EMBEDDED) ::Volume *v = Create_Volume(num, MSH_VOLUME_DISCRETE); Tree_Add(model->getGEOInternals()->Volumes, &v); -#endif } void discreteRegion::setBoundFaces() { - //in case discrete region already exist //to modify to take into account appropriate faces for(GModel::fiter face = model()->firstFace(); face != model()->lastFace(); face++){ @@ -29,6 +23,4 @@ void discreteRegion::setBoundFaces() (*face)->addRegion(this); printf("face %d \n", (*face)->tag()); } - - } diff --git a/Makefile b/Makefile index fdb0a6fdbb1b3553ac716de58f05ffec6c2fa5af..bf275216bf0e4aab911b5bfbec16113944d0da7e 100644 --- a/Makefile +++ b/Makefile @@ -19,15 +19,15 @@ GMSH_VERSION_FILE = Common/GmshVersion.h GMSH_DATE = `date "+%Y%m%d"` GMSH_API =\ - Geo/GModel.h Geo/GEntity.h Geo/GPoint.h Geo/GVertex.h Geo/GEdge.h Geo/GFace.h\ - Geo/GRegion.h Geo/GEdgeLoop.h Geo/GFaceCompound.h Geo/GRegionCompound.h\ - Geo/MVertex.h Geo/MEdge.h Geo/MFace.h Geo/MElement.h\ - Geo/MPoint.h Geo/MLine.h Geo/MTriangle.h Geo/MQuadrangle.h\ - Geo/MTetrahedron.h Geo/MHexahedron.h Geo/MPrism.h Geo/MPyramid.h\ + Geo/GModel.h Geo/GEntity.h\ + Geo/GPoint.h Geo/GVertex.h Geo/GEdge.h Geo/GFace.h Geo/GRegion.h\ + Geo/GEdgeLoop.h Geo/GEdgeCompound.h Geo/GFaceCompound.h Geo/GRegionCompound.h\ + Geo/MVertex.h Geo/MEdge.h Geo/MFace.h Geo/MElement.h Geo/MPoint.h Geo/MLine.h\ + Geo/MTriangle.h Geo/MQuadrangle.h Geo/MTetrahedron.h Geo/MHexahedron.h\ + Geo/MPrism.h Geo/MPyramid.h Geo/MElementCut.h\ Geo/discreteVertex.h Geo/discreteEdge.h Geo/discreteFace.h Geo/discreteRegion.h\ - Geo/SPoint2.h Geo/SPoint3.h Geo/SVector3.h Geo/SBoundingBox3d.h Geo/Pair.h Geo/Range.h\ - Geo/SOrientedBoundingBox.h\ - Geo/CellComplex.h Geo/ChainComplex.h\ + Geo/SPoint2.h Geo/SPoint3.h Geo/SVector3.h Geo/SBoundingBox3d.h Geo/Pair.h\ + Geo/Range.h Geo/SOrientedBoundingBox.h Geo/CellComplex.h Geo/ChainComplex.h\ contrib/kbipack/gmp_normal_form.h contrib/kbipack/gmp_matrix.h contrib/kbipack/gmp_blas.h\ Numeric/Gauss.h Numeric/FunctionSpace.h Numeric/GmshMatrix.h\ Numeric/gmshAssembler.h Numeric/gmshTermOfFormulation.h Numeric/gmshLaplace.h\ @@ -38,17 +38,6 @@ GMSH_API =\ Common/VertexArray.h Common/GmshMessage.h\ Common/Gmsh.h Common/GmshConfig.h Common/GmshDefines.h Common/GmshVersion.h - -GMSH_EMBEDDED = ${GMSH_API}\ - Geo/GModel.cpp Geo/GModelIO_Mesh.cpp Geo/GEntity.cpp\ - Geo/GVertex.cpp Geo/GEdge.cpp Geo/GEdgeLoop.cpp Geo/GFace.cpp Geo/GRegion.cpp\ - Geo/discreteEdge.cpp Geo/discreteFace.cpp Geo/discreteRegion.cpp\ - Geo/MVertex.cpp Geo/MFace.cpp Geo/MElement.cpp Geo/MLine.cpp\ - Geo/MTriangle.cpp Geo/MQuadrangle.cpp Geo/MTetrahedron.cpp\ - Geo/MHexahedron.cpp Geo/MPrism.cpp Geo/MPyramid.cpp\ - Numeric/Numeric.{cpp,h} Numeric/FunctionSpace.cpp Common/StringUtils.{cpp,h}\ - utils/embed/GmshEmbedded.{cpp,h} utils/embed/Makefile - # Main building rules all: link @@ -134,11 +123,6 @@ uninstall-lib: rm -rf ${includedir}/gmsh rm -rf ${libdir}/libGmsh${LIBSUFFIX}${LIBEXT} -embed: - @if [ -r ../getdp/contrib/gmsh/Makefile ]; then\ - rsync -av ${GMSH_EMBEDDED} ../getdp/contrib/gmsh;\ - fi - # Macintosh-specific rules link-mac-universal: compile