Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
13b98a88
Commit
13b98a88
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
reverse elements if physical < 0 for MESH, IR3 and DIFF formats, too
parent
1e1b6634
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Geo/MElement.cpp
+21
-5
21 additions, 5 deletions
Geo/MElement.cpp
with
21 additions
and
5 deletions
Geo/MElement.cpp
+
21
−
5
View file @
13b98a88
...
@@ -1305,6 +1305,8 @@ void MElement::writeUNV(FILE *fp, int num, int elementary, int physical)
...
@@ -1305,6 +1305,8 @@ void MElement::writeUNV(FILE *fp, int num, int elementary, int physical)
void
MElement
::
writeMESH
(
FILE
*
fp
,
int
elementTagType
,
int
elementary
,
void
MElement
::
writeMESH
(
FILE
*
fp
,
int
elementTagType
,
int
elementary
,
int
physical
)
int
physical
)
{
{
if
(
physical
<
0
)
reverse
();
for
(
int
i
=
0
;
i
<
getNumVertices
();
i
++
)
for
(
int
i
=
0
;
i
<
getNumVertices
();
i
++
)
if
(
getTypeForMSH
()
==
MSH_TET_10
&&
i
==
8
)
if
(
getTypeForMSH
()
==
MSH_TET_10
&&
i
==
8
)
fprintf
(
fp
,
" %d"
,
getVertex
(
9
)
->
getIndex
());
fprintf
(
fp
,
" %d"
,
getVertex
(
9
)
->
getIndex
());
...
@@ -1313,18 +1315,24 @@ void MElement::writeMESH(FILE *fp, int elementTagType, int elementary,
...
@@ -1313,18 +1315,24 @@ void MElement::writeMESH(FILE *fp, int elementTagType, int elementary,
else
else
fprintf
(
fp
,
" %d"
,
getVertex
(
i
)
->
getIndex
());
fprintf
(
fp
,
" %d"
,
getVertex
(
i
)
->
getIndex
());
fprintf
(
fp
,
" %d
\n
"
,
(
elementTagType
==
3
)
?
_partition
:
fprintf
(
fp
,
" %d
\n
"
,
(
elementTagType
==
3
)
?
_partition
:
(
elementTagType
==
2
)
?
physical
:
elementary
);
(
elementTagType
==
2
)
?
abs
(
physical
)
:
elementary
);
if
(
physical
<
0
)
reverse
();
}
}
void
MElement
::
writeIR3
(
FILE
*
fp
,
int
elementTagType
,
int
num
,
int
elementary
,
void
MElement
::
writeIR3
(
FILE
*
fp
,
int
elementTagType
,
int
num
,
int
elementary
,
int
physical
)
int
physical
)
{
{
if
(
physical
<
0
)
reverse
();
int
numVert
=
getNumVertices
();
int
numVert
=
getNumVertices
();
fprintf
(
fp
,
"%d %d %d"
,
num
,
(
elementTagType
==
3
)
?
_partition
:
fprintf
(
fp
,
"%d %d %d"
,
num
,
(
elementTagType
==
3
)
?
_partition
:
(
elementTagType
==
2
)
?
physical
:
elementary
,
numVert
);
(
elementTagType
==
2
)
?
abs
(
physical
)
:
elementary
,
numVert
);
for
(
int
i
=
0
;
i
<
numVert
;
i
++
)
for
(
int
i
=
0
;
i
<
numVert
;
i
++
)
fprintf
(
fp
,
" %d"
,
getVertex
(
i
)
->
getIndex
());
fprintf
(
fp
,
" %d"
,
getVertex
(
i
)
->
getIndex
());
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
"
\n
"
);
if
(
physical
<
0
)
reverse
();
}
}
void
MElement
::
writeBDF
(
FILE
*
fp
,
int
format
,
int
elementTagType
,
int
elementary
,
void
MElement
::
writeBDF
(
FILE
*
fp
,
int
format
,
int
elementTagType
,
int
elementary
,
...
@@ -1337,8 +1345,10 @@ void MElement::writeBDF(FILE *fp, int format, int elementTagType, int elementary
...
@@ -1337,8 +1345,10 @@ void MElement::writeBDF(FILE *fp, int format, int elementTagType, int elementary
const
char
*
cont
[
4
]
=
{
"E"
,
"F"
,
"G"
,
"H"
};
const
char
*
cont
[
4
]
=
{
"E"
,
"F"
,
"G"
,
"H"
};
int
ncont
=
0
;
int
ncont
=
0
;
if
(
physical
<
0
)
reverse
();
int
tag
=
(
elementTagType
==
3
)
?
_partition
:
(
elementTagType
==
2
)
?
int
tag
=
(
elementTagType
==
3
)
?
_partition
:
(
elementTagType
==
2
)
?
physical
:
elementary
;
abs
(
physical
)
:
elementary
;
if
(
format
==
0
){
// free field format
if
(
format
==
0
){
// free field format
fprintf
(
fp
,
"%s,%d,%d"
,
str
,
_num
,
tag
);
fprintf
(
fp
,
"%s,%d,%d"
,
str
,
_num
,
tag
);
...
@@ -1366,23 +1376,29 @@ void MElement::writeBDF(FILE *fp, int format, int elementTagType, int elementary
...
@@ -1366,23 +1376,29 @@ void MElement::writeBDF(FILE *fp, int format, int elementTagType, int elementary
fprintf
(
fp
,
"%-8s%-8s%-8s"
,
"0."
,
"0."
,
"0."
);
fprintf
(
fp
,
"%-8s%-8s%-8s"
,
"0."
,
"0."
,
"0."
);
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
"
\n
"
);
}
}
if
(
physical
<
0
)
reverse
();
}
}
void
MElement
::
writeDIFF
(
FILE
*
fp
,
int
num
,
bool
binary
,
int
physical
_property
)
void
MElement
::
writeDIFF
(
FILE
*
fp
,
int
num
,
bool
binary
,
int
physical
)
{
{
const
char
*
str
=
getStringForDIFF
();
const
char
*
str
=
getStringForDIFF
();
if
(
!
str
)
return
;
if
(
!
str
)
return
;
if
(
physical
<
0
)
reverse
();
int
n
=
getNumVertices
();
int
n
=
getNumVertices
();
if
(
binary
){
if
(
binary
){
// TODO
// TODO
}
}
else
{
else
{
fprintf
(
fp
,
"%d %s %d "
,
num
,
str
,
physical
_property
);
fprintf
(
fp
,
"%d %s %d "
,
num
,
str
,
abs
(
physical
)
);
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
int
i
=
0
;
i
<
n
;
i
++
)
fprintf
(
fp
,
" %d"
,
getVertexDIFF
(
i
)
->
getIndex
());
fprintf
(
fp
,
" %d"
,
getVertexDIFF
(
i
)
->
getIndex
());
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
"
\n
"
);
}
}
if
(
physical
<
0
)
reverse
();
}
}
void
MElement
::
writeINP
(
FILE
*
fp
,
int
num
)
void
MElement
::
writeINP
(
FILE
*
fp
,
int
num
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment