From c6bf9de74a4f9d2422be4d68e056730384b38d88 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sat, 24 Aug 2013 18:01:59 +0000 Subject: [PATCH] INP (Abaqus) output should not have more than 16 values per line --- Geo/MElement.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp index 1faf020b00..b8b2c78b79 100644 --- a/Geo/MElement.cpp +++ b/Geo/MElement.cpp @@ -1157,9 +1157,15 @@ void MElement::writeDIFF(FILE *fp, int num, bool binary, int physical_property) void MElement::writeINP(FILE *fp, int num) { setVolumePositive(); - fprintf(fp, "%d", num); - for(int i = 0; i < getNumVertices(); i++) - fprintf(fp, ", %d", getVertexINP(i)->getIndex()); + fprintf(fp, "%d, ", num); + int n = getNumVertices(); + for(int i = 0; i < n; i++){ + fprintf(fp, "%d", getVertexINP(i)->getIndex()); + if(i != n - 1){ + fprintf(fp, ", "); + if(i && !((i+2) % 16)) fprintf(fp, "\n"); + } + } fprintf(fp, "\n"); } -- GitLab