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

don't save node/element data by default

parent 09139da6
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
......
......@@ -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);
}
......@@ -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); }
......
......@@ -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++){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment