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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nico Schlömer
gmsh
Commits
9e83cfe9
Commit
9e83cfe9
authored
7 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix windows compile
parent
8ecfe133
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/GModelIO_NEU.cpp
+9
-10
9 additions, 10 deletions
Geo/GModelIO_NEU.cpp
with
9 additions
and
10 deletions
Geo/GModelIO_NEU.cpp
+
9
−
10
View file @
9e83cfe9
...
@@ -88,7 +88,8 @@ namespace
...
@@ -88,7 +88,8 @@ namespace
hashMap
<
std
::
string
,
unsigned
>::
_
::
value_type
(
"WALL"
,
51
),
hashMap
<
std
::
string
,
unsigned
>::
_
::
value_type
(
"WALL"
,
51
),
hashMap
<
std
::
string
,
unsigned
>::
_
::
value_type
(
"SPRING"
,
52
),
hashMap
<
std
::
string
,
unsigned
>::
_
::
value_type
(
"SPRING"
,
52
),
};
};
static
const
hashMap
<
std
::
string
,
unsigned
>::
_
boundaryCodeMap
(
rawData
,
rawData
+
(
sizeof
rawData
/
sizeof
rawData
[
0
]));
static
const
hashMap
<
std
::
string
,
unsigned
>::
_
boundaryCodeMap
(
rawData
,
rawData
+
(
sizeof
rawData
/
sizeof
rawData
[
0
]));
// Gambit numbers its faces slightly differently
// Gambit numbers its faces slightly differently
static
const
unsigned
GAMBIT_FACE_MAP
[
4
]
=
{
1
,
2
,
4
,
3
};
static
const
unsigned
GAMBIT_FACE_MAP
[
4
]
=
{
1
,
2
,
4
,
3
};
...
@@ -208,13 +209,9 @@ int GModel::writeNEU(const std::string &name, bool saveAll,
...
@@ -208,13 +209,9 @@ int GModel::writeNEU(const std::string &name, bool saveAll,
fprintf
(
fp
,
"Gmsh mesh in GAMBIT neutral file format
\n
"
);
fprintf
(
fp
,
"Gmsh mesh in GAMBIT neutral file format
\n
"
);
fprintf
(
fp
,
"PROGRAM: Gambit VERSION: 2.0.0
\n
"
);
fprintf
(
fp
,
"PROGRAM: Gambit VERSION: 2.0.0
\n
"
);
char
datestring
[
256
];
time_t
rawtime
;
time_t
rawtime
;
struct
tm
*
timeinfo
;
time
(
&
rawtime
);
time
(
&
rawtime
);
timeinfo
=
localtime
(
&
rawtime
);
fprintf
(
fp
,
"%s"
,
ctime
(
&
rawtime
));
strftime
(
datestring
,
sizeof
(
datestring
),
"%c"
,
timeinfo
);
fprintf
(
fp
,
"%s
\n
"
,
datestring
);
fprintf
(
fp
,
" NUMNP NELEM NGRPS NBSETS NDFCD NDFVL
\n
"
);
fprintf
(
fp
,
" NUMNP NELEM NGRPS NBSETS NDFCD NDFVL
\n
"
);
fprintf
(
fp
,
" %9d %9d %9lu %9lu %9d %9d
\n
"
,
indexMeshVertices
(
saveAll
),
numTetrahedra
,
fprintf
(
fp
,
" %9d %9d %9lu %9lu %9d %9d
\n
"
,
indexMeshVertices
(
saveAll
),
numTetrahedra
,
...
@@ -251,7 +248,8 @@ int GModel::writeNEU(const std::string &name, bool saveAll,
...
@@ -251,7 +248,8 @@ int GModel::writeNEU(const std::string &name, bool saveAll,
for
(
hashMap
<
unsigned
,
std
::
vector
<
unsigned
>
>::
_
::
const_iterator
for
(
hashMap
<
unsigned
,
std
::
vector
<
unsigned
>
>::
_
::
const_iterator
it
=
elementGroups
.
begin
();
it
!=
elementGroups
.
end
();
++
it
)
{
it
=
elementGroups
.
begin
();
it
!=
elementGroups
.
end
();
++
it
)
{
fprintf
(
fp
,
" ELEMENT GROUP 2.0.0
\n
"
);
fprintf
(
fp
,
" ELEMENT GROUP 2.0.0
\n
"
);
fprintf
(
fp
,
"GROUP: %10d ELEMENTS: %10lu MATERIAL: 0 NFLAGS: %10d
\n
"
,
it
->
first
,
it
->
second
.
size
(),
1
);
fprintf
(
fp
,
"GROUP: %10d ELEMENTS: %10lu MATERIAL: 0 NFLAGS: %10d
\n
"
,
it
->
first
,
it
->
second
.
size
(),
1
);
fprintf
(
fp
,
"Material group %d
\n
"
,
it
->
first
);
fprintf
(
fp
,
"Material group %d
\n
"
,
it
->
first
);
fprintf
(
fp
,
" 0"
);
fprintf
(
fp
,
" 0"
);
...
@@ -271,10 +269,11 @@ int GModel::writeNEU(const std::string &name, bool saveAll,
...
@@ -271,10 +269,11 @@ int GModel::writeNEU(const std::string &name, bool saveAll,
fprintf
(
fp
,
" BOUNDARY CONDITIONS 2.0.0
\n
"
);
fprintf
(
fp
,
" BOUNDARY CONDITIONS 2.0.0
\n
"
);
std
::
string
const
regionName
=
getPhysicalName
(
2
,
it
->
first
);
std
::
string
const
regionName
=
getPhysicalName
(
2
,
it
->
first
);
fprintf
(
fp
,
"%32s%8d%8lu%8d%8d
\n
"
,
regionName
.
c_str
(),
1
,
it
->
second
.
size
(),
0
,
gambitBoundaryCode
(
regionName
));
fprintf
(
fp
,
"%32s%8d%8lu%8d%8d
\n
"
,
regionName
.
c_str
(),
1
,
it
->
second
.
size
(),
0
,
gambitBoundaryCode
(
regionName
));
std
::
sort
(
it
->
second
.
begin
(),
it
->
second
.
end
(),
sortBCs
);
std
::
sort
(
it
->
second
.
begin
(),
it
->
second
.
end
(),
sortBCs
);
std
::
vector
<
TetFacePair
>::
iterator
tfp
=
it
->
second
.
begin
();
for
(
std
::
vector
<
TetFacePair
>::
iterator
tfp
=
it
->
second
.
begin
();
for
(
std
::
vector
<
TetFacePair
>::
iterator
tfp
=
it
->
second
.
begin
();
tfp
!=
it
->
second
.
end
();
++
tfp
)
{
tfp
!=
it
->
second
.
end
();
++
tfp
)
{
fprintf
(
fp
,
"%10d %5d %5d
\n
"
,
tfp
->
first
-
lowestId
,
GAMBIT_TYPE_TET
,
tfp
->
second
);
fprintf
(
fp
,
"%10d %5d %5d
\n
"
,
tfp
->
first
-
lowestId
,
GAMBIT_TYPE_TET
,
tfp
->
second
);
}
}
...
...
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