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,6 +88,7 @@ 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
virtual MVertex *getVertexBDF(int num){ return getVertex(num); }
......
......@@ -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; }
......
......@@ -129,14 +129,32 @@ bool PViewDataGModel::writeMSH(std::string fileName, bool binary)
GModel *model = _steps[0]->getModel();
bool writeNodesAndElements = false;
FILE *fp;
if(writeNodesAndElements){
if(!model->writeMSH(fileName, 2.0, binary)) return false;
// append data
FILE *fp = fopen(fileName.c_str(), binary ? "ab" : "a");
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++){
int numEnt = 0, numComp = _steps[step]->getNumComponents();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment