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
Larry Price
gmsh
Commits
a8296ad7
Commit
a8296ad7
authored
8 years ago
by
Koen Hillewaert
Browse files
Options
Downloads
Patches
Plain Diff
use of cgsize_t to allow for 64bit capable cgns
parent
3c9ecc1f
Branches
cgnsUnstructured
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Geo/CGNSFunctions.cpp
+4
-0
4 additions, 0 deletions
Geo/CGNSFunctions.cpp
Geo/GModel.h
+9
-1
9 additions, 1 deletion
Geo/GModel.h
Geo/GModelIO_CGNS.cpp
+11
-34
11 additions, 34 deletions
Geo/GModelIO_CGNS.cpp
with
24 additions
and
35 deletions
Geo/CGNSFunctions.cpp
+
4
−
0
View file @
a8296ad7
...
...
@@ -17,7 +17,11 @@
#include
"fullMatrix.h"
#include
"GmshDefines.h"
namespace
CGNS
{
#include
<cgnslib.h>
};
using
namespace
CGNS
;
#include
<vector>
// -----------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Geo/GModel.h
+
9
−
1
View file @
a8296ad7
...
...
@@ -18,6 +18,12 @@
#include
"SPoint3.h"
#include
"SBoundingBox3d.h"
#ifdef HAVE_LIBCGNS
namespace
CGNS
{
#include
<cgnslib.h>
}
#endif
template
<
class
scalar
>
class
simpleFunction
;
class
FM_Internals
;
...
...
@@ -722,6 +728,7 @@ class GModel {
// SU2 mesh file
int
writeSU2
(
const
std
::
string
&
name
,
bool
saveAll
,
double
scalingFactor
);
#if defined HAVE_LIBCGNS
protected
:
int
readCGNSBase
(
const
std
::
string
&
name
,
int
&
nbases
)
const
;
...
...
@@ -731,12 +738,13 @@ protected:
int
fileIndex
,
int
baseIndex
,
int
zoneIndex
,
in
t
nbPoints
,
CGNS
::
cgsize_
t
nbPoints
,
int
dim
,
GEntity
*
ge
,
int
&
pointIndex
,
std
::
map
<
int
,
MVertex
*>&
vertices
);
#endif
};
...
...
This diff is collapsed.
Click to expand it.
Geo/GModelIO_CGNS.cpp
+
11
−
34
View file @
a8296ad7
...
...
@@ -52,9 +52,12 @@
#include
"MZone.h"
#include
"MZoneBoundary.h"
namespace
CGNS
{
#include
<cgnslib.h>
}
using
namespace
std
;
using
namespace
CGNS
;
#define maxLenCGNS 32
...
...
@@ -950,7 +953,7 @@ int GModel::addCGNSPoints(const string& fileName,
int
fileIndex
,
int
baseIndex
,
int
zoneIndex
,
in
t
nbPoints
,
int
dim
,
cgsize_
t
nbPoints
,
int
dim
,
GEntity
*
entity
,
int
&
index
,
std
::
map
<
int
,
MVertex
*>&
vertices
)
{
...
...
@@ -972,12 +975,10 @@ int GModel::addCGNSPoints(const string& fileName,
double
*
xyz
=
new
double
[
nbPoints
*
3
];
for
(
int
i
=
0
;
i
<
3
*
nbPoints
;
i
++
)
xyz
[
i
]
=
0
;
std
::
cout
<<
"Reading "
<<
nbPoints
<<
" points "
<<
std
::
endl
;
for
(
int
iCoord
=
0
;
iCoord
<
dim
;
iCoord
++
)
{
char
coordName
[
maxLenCGNS
];
in
t
indBeg
(
1
);
cgsize_
t
indBeg
(
1
);
DataType_t
dataType
;
if
(
cg_coord_info
(
fileIndex
,
baseIndex
,
zoneIndex
,
...
...
@@ -995,9 +996,6 @@ int GModel::addCGNSPoints(const string& fileName,
delete
[]
xyz
;
return
0
;
}
std
::
cout
<<
"Read coordinate "
<<
iCoord
<<
std
::
endl
;
}
const
double
*
x
=
xyz
;
...
...
@@ -1008,18 +1006,10 @@ int GModel::addCGNSPoints(const string& fileName,
vertices
[
index
]
=
new
MVertex
(
x
[
i
],
y
[
i
],
z
[
i
],
entity
,
index
);
index
++
;
}
std
::
cout
<<
"Created all points "
<<
std
::
endl
;
delete
[]
xyz
;
std
::
cout
<<
"Cleaned coordinates "
<<
std
::
endl
;
return
1
;
}
// -----------------------------------------------------------------------------
int
GModel
::
readCGNSUnstructured
(
const
std
::
string
&
fileName
)
...
...
@@ -1160,9 +1150,6 @@ int GModel::readCGNSUnstructured(const std::string& fileName)
family
[
familyName
]
=
familyIndex
;
}
std
::
cout
<<
"Reading zone "
<<
zoneIndex
<<
" on family "
<<
familyIndex
<<
std
::
endl
;
// --- read coordinates and create vertices
addCGNSPoints
(
fileName
,
...
...
@@ -1189,14 +1176,12 @@ int GModel::readCGNSUnstructured(const std::string& fileName)
// connectivity corresponds to a given element type
std
::
cout
<<
"Read number of sections"
<<
std
::
endl
;
for
(
int
sectIndex
=
1
;
sectIndex
<=
nbSections
;
sectIndex
++
)
{
char
sectName
[
maxLenCGNS
];
ElementType_t
cgnsType
;
in
t
eltBeg
;
in
t
eltEnd
;
cgsize_
t
eltBeg
;
cgsize_
t
eltEnd
;
int
nbBound
;
int
parentFlag
;
...
...
@@ -1211,12 +1196,6 @@ int GModel::readCGNSUnstructured(const std::string& fileName)
int
nbElt
=
eltEnd
-
eltBeg
+
1
;
std
::
cout
<<
"Have "
<<
nbElt
<<
" elements of type "
<<
cgnsType
<<
" in section "
<<
std
::
endl
;
// --- topological information
std
::
cout
<<
"Got renumbering "
<<
std
::
endl
;
// --- read connections
cgsize_t
sectSize
;
...
...
@@ -1241,8 +1220,6 @@ int GModel::readCGNSUnstructured(const std::string& fileName)
return
0
;
}
std
::
cout
<<
"Read elements "
<<
std
::
endl
;
cgsize_t
*
pElt
=
elts
;
for
(
int
iElt
=
0
;
iElt
<
nbElt
;
iElt
++
)
{
...
...
@@ -2570,7 +2547,7 @@ int write_CGNS_zones(GModel &model, const int zoneDefinition, const int numZone,
// In the first zone
if
(
cg_conn_write
(
cgIndexFile
,
cgIndexBase
,
zoneInfo
[
gCIt
->
first
.
zone1
].
cgIndex
,
interfaceName
.
c_str
(),
Vertex
,
Abutting1to1
,
PointList
,
nVert
,
interfaceName
.
c_str
(),
CGNS
::
Vertex
,
Abutting1to1
,
PointList
,
nVert
,
&
iBuffer1
[
0
],
zoneInfo
[
gCIt
->
first
.
zone2
].
name
.
c_str
(),
Unstructured
,
PointListDonor
,
Integer
,
nVert
,
&
iBuffer2
[
0
],
&
cgIndexInterface
))
...
...
@@ -2580,7 +2557,7 @@ int write_CGNS_zones(GModel &model, const int zoneDefinition, const int numZone,
// In the second zone
if
(
cg_conn_write
(
cgIndexFile
,
cgIndexBase
,
zoneInfo
[
gCIt
->
first
.
zone2
].
cgIndex
,
interfaceName
.
c_str
(),
Vertex
,
Abutting1to1
,
PointList
,
nVert
,
interfaceName
.
c_str
(),
CGNS
::
Vertex
,
Abutting1to1
,
PointList
,
nVert
,
&
iBuffer2
[
0
],
zoneInfo
[
gCIt
->
first
.
zone1
].
name
.
c_str
(),
Unstructured
,
PointListDonor
,
Integer
,
nVert
,
&
iBuffer1
[
0
],
&
cgIndexInterface
))
...
...
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