diff --git a/Geo/GModel.h b/Geo/GModel.h index 1b491bfd78adb10da6c3b04b8b66b9a723f57d48..2b376b838bffa34a0977cd35f8913a62483b2fbf 100644 --- a/Geo/GModel.h +++ b/Geo/GModel.h @@ -353,9 +353,6 @@ class GModel void createTopologyFromMesh(); void createTopologyFromFaces(std::vector<discreteFace*> &pFaces); - // compute distance function - void computeDistanceFunction(); - // a container for smooth normals smooth_normals *normals; diff --git a/Geo/MElement.h b/Geo/MElement.h index 0d5ac4bc74bcbdb69afb5e33b186823fb4fc8f28..da25f024db33ba50e5e9e6cd2232176634d91494 100644 --- a/Geo/MElement.h +++ b/Geo/MElement.h @@ -88,7 +88,8 @@ class MElement // get the vertex using the VTK ordering virtual MVertex *getVertexVTK(int num){ return getVertex(num); } -// get the vertex using the Nastran BDF ordering + + // get the vertex using the Nastran BDF ordering virtual MVertex *getVertexBDF(int num){ return getVertex(num); } // get the vertex using MED ordering @@ -164,7 +165,7 @@ class MElement virtual MElement *getDomain(int i) const { return NULL; } virtual void setDomain (MElement *e, int i) { } - //get the type of the element + // get the type of the element virtual int getType() const = 0; // get the max/min edge length diff --git a/Geo/MVertex.cpp b/Geo/MVertex.cpp index bfdedec319d9ee6bfbea6a8ddd4e9a1e8cc8ef93..3d1e5a461157370e0cf3c230e9df4726bfe61f7d 100644 --- a/Geo/MVertex.cpp +++ b/Geo/MVertex.cpp @@ -429,7 +429,7 @@ void MVertex::registerBindings(binding *b) cm->setDescription("return the invariant vertex id"); cm = cb->addMethod("getPolynomialOrder", &MVertex::getPolynomialOrder); cm->setDescription("return the polynomial order of vertex"); - cm = cb->addMethod("setPolynomialOrder", &MVertex::setPolynomialOrder_binding); + cm = cb->addMethod("setPolynomialOrder", &MVertex::setPolynomialOrder); cm->setDescription("assign the polynomial order of vertex"); cm->setArgNames("order",NULL); } diff --git a/Geo/MVertex.h b/Geo/MVertex.h index a568d7aa7eafe3a7e278386904abc240a1c54cb7..0921285f941410dadf0d89a521acc99dd6c70d03 100644 --- a/Geo/MVertex.h +++ b/Geo/MVertex.h @@ -58,8 +58,7 @@ class MVertex{ // get the "polynomial order" of the vertex inline int getPolynomialOrder(){ return _order; } - inline void setPolynomialOrder(char order){ _order = order; } - inline void setPolynomialOrder_binding(int order){ _order = order; } + inline void setPolynomialOrder(int order){ _order = (char)order; } // get/set the coordinates inline double x() const { return _x; } @@ -69,7 +68,7 @@ class MVertex{ inline double & y() { return _y; } inline double & z() { return _z; } // cannot use the reference to set the value in the bindings - inline void setXYZ(double x,double y, double z) {_x=x; _y=y; _z=z; } + inline void setXYZ(double x, double y, double z) { _x = x; _y = y; _z = z; } inline SPoint3 point() const { return SPoint3(_x, _y, _z); } diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp index 51119e94939cb025f458d7b324ac6b20deb02882..9e8526776e97df28f140b31b99121332d0d4e719 100644 --- a/Post/PViewDataGModelIO.cpp +++ b/Post/PViewDataGModelIO.cpp @@ -129,13 +129,31 @@ bool PViewDataGModel::writeMSH(std::string fileName, bool binary) GModel *model = _steps[0]->getModel(); - if(!model->writeMSH(fileName, 2.0, binary)) return false; - - // append data - FILE *fp = fopen(fileName.c_str(), binary ? "ab" : "a"); - if(!fp){ - Msg::Error("Unable to open file '%s'", fileName.c_str()); - return false; + bool writeNodesAndElements = false; + FILE *fp; + if(writeNodesAndElements){ + if(!model->writeMSH(fileName, 2.0, binary)) return false; + // append data + fp = fopen(fileName.c_str(), binary ? "ab" : "a"); + if(!fp){ + Msg::Error("Unable to open file '%s'", fileName.c_str()); + return false; + } + } + else{ + fp = fopen(fileName.c_str(), binary ? "wb" : "w"); + if(!fp){ + Msg::Error("Unable to open file '%s'", fileName.c_str()); + return false; + } + fprintf(fp, "$MeshFormat\n"); + fprintf(fp, "%g %d %d\n", 2.2, binary ? 1 : 0, (int)sizeof(double)); + if(binary){ + int one = 1; + fwrite(&one, sizeof(int), 1, fp); + fprintf(fp, "\n"); + } + fprintf(fp, "$EndMeshFormat\n"); } for(unsigned int step = 0; step < _steps.size(); step++){