18 std::vector<MVertex *> &vec)
20 for(
int i = 0; i < num; i++) {
34 FILE *fp =
Fopen(name.c_str(),
"r");
36 Msg::Error(
"Unable to open file '%s'", name.c_str());
41 if(!fgets(buffer,
sizeof(buffer), fp)) {
46 if(strncmp(buffer,
"BEGIN ACTRAN", 12)) {
53 std::map<int, std::vector<MElement *> > elements[3];
54 int nbv = 0, nbe = 0, dim = 0;
57 if(!fgets(buffer, 256, fp))
break;
58 char str[256], str2[256];
59 sscanf(buffer,
"%s %s", str, str2);
60 if(!strcmp(str,
"BEGIN") && !strcmp(str2,
"MESH")) {
61 if(!fgets(buffer,
sizeof(buffer), fp))
break;
62 sscanf(buffer,
"%d %d %d", &nbv, &nbe, &dim);
63 if(dim == 3 || dim == 2)
64 Msg::Info(
"ACTRAN mesh dimension %d", dim);
66 Msg::Error(
"Cannot read ACTRAN mesh of dimension %d", dim);
70 else if(!strcmp(str,
"BEGIN") && !strcmp(str2,
"NODE")) {
72 for(
int i = 0; i < nbv; i++) {
73 if(!fgets(buffer,
sizeof(buffer), fp))
break;
77 sscanf(buffer,
"%d %lf %lf %lf", &num, &x, &y, &
z);
79 sscanf(buffer,
"%d %lf %lf", &num, &x, &y);
83 else if(!strcmp(str,
"BEGIN") && !strcmp(str2,
"ELEMENT")) {
85 for(
int i = 0; i < nbe; i++) {
86 if(!fgets(buffer,
sizeof(buffer), fp))
break;
87 int num, type, reg, n[8];
88 sscanf(buffer,
"%d %d %d", &num, &type, ®);
91 sscanf(buffer,
"%d %d %d %d %d", &num, &type, ®, &n[0], &n[1]);
96 sscanf(buffer,
"%d %d %d %d %d %d", &num, &type, ®, &n[0], &n[1],
102 sscanf(buffer,
"%d %d %d %d %d %d %d", &num, &type, ®, &n[0],
103 &n[1], &n[2], &n[3]);
108 Msg::Error(
"Unknown type %d for element %d", type, num);
114 for(
int i = 0; i < (int)(
sizeof(elements) /
sizeof(elements[0])); i++)