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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
8484b79f
Commit
8484b79f
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
pp
parent
0ae38cbb
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/GModelIO_MED.cpp
+2
-2
2 additions, 2 deletions
Geo/GModelIO_MED.cpp
Post/PViewData.h
+3
-3
3 additions, 3 deletions
Post/PViewData.h
Post/PViewDataGModelIO.cpp
+13
-42
13 additions, 42 deletions
Post/PViewDataGModelIO.cpp
Post/PViewDataIO.cpp
+19
-1
19 additions, 1 deletion
Post/PViewDataIO.cpp
with
37 additions
and
48 deletions
Geo/GModelIO_MED.cpp
+
2
−
2
View file @
8484b79f
// $Id: GModelIO_MED.cpp,v 1.2
4
2008-04-02
18:57:57
geuzaine Exp $
// $Id: GModelIO_MED.cpp,v 1.2
5
2008-04-02
20:00:38
geuzaine Exp $
//
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -37,7 +37,7 @@ extern "C" {
...
@@ -37,7 +37,7 @@ extern "C" {
#include
<med.h>
#include
<med.h>
}
}
static
med_geometrie_element
msh2medElementType
(
int
msh
)
med_geometrie_element
msh2medElementType
(
int
msh
)
{
{
switch
(
msh
)
{
switch
(
msh
)
{
case
MSH_LIN_2
:
return
MED_SEG2
;
case
MSH_LIN_2
:
return
MED_SEG2
;
...
...
This diff is collapsed.
Click to expand it.
Post/PViewData.h
+
3
−
3
View file @
8484b79f
...
@@ -118,9 +118,9 @@ class PViewData {
...
@@ -118,9 +118,9 @@ class PViewData {
virtual
bool
writeSTL
(
std
::
string
fileName
);
virtual
bool
writeSTL
(
std
::
string
fileName
);
virtual
bool
writeTXT
(
std
::
string
fileName
);
virtual
bool
writeTXT
(
std
::
string
fileName
);
virtual
bool
writePOS
(
std
::
string
fileName
,
bool
binary
=
false
,
bool
parsed
=
true
,
virtual
bool
writePOS
(
std
::
string
fileName
,
bool
binary
=
false
,
bool
parsed
=
true
,
bool
append
=
false
)
{
return
false
;
}
bool
append
=
false
)
;
virtual
bool
writeMSH
(
std
::
string
fileName
,
bool
binary
=
false
)
{
return
false
;
}
virtual
bool
writeMSH
(
std
::
string
fileName
,
bool
binary
=
false
)
;
virtual
bool
writeMED
(
std
::
string
fileName
)
{
return
false
;
}
virtual
bool
writeMED
(
std
::
string
fileName
)
;
};
};
class
nameData
{
class
nameData
{
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModelIO.cpp
+
13
−
42
View file @
8484b79f
// $Id: PViewDataGModelIO.cpp,v 1.3
5
2008-04-02
18:57:57
geuzaine Exp $
// $Id: PViewDataGModelIO.cpp,v 1.3
6
2008-04-02
20:00:38
geuzaine Exp $
//
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -147,6 +147,7 @@ extern "C" {
...
@@ -147,6 +147,7 @@ extern "C" {
#include
<med.h>
#include
<med.h>
}
}
extern
med_geometrie_element
msh2medElementType
(
int
msh
);
extern
int
med2mshElementType
(
med_geometrie_element
med
);
extern
int
med2mshElementType
(
med_geometrie_element
med
);
extern
int
med2mshNodeIndex
(
med_geometrie_element
med
,
int
k
);
extern
int
med2mshNodeIndex
(
med_geometrie_element
med
,
int
k
);
...
@@ -408,48 +409,20 @@ bool PViewDataGModel::writeMED(std::string fileName)
...
@@ -408,48 +409,20 @@ bool PViewDataGModel::writeMED(std::string fileName)
}
}
// compute profile
// compute profile
char
*
profileName
;
char
*
profileName
=
(
char
*
)
"nodeProfile"
;
std
::
vector
<
med_int
>
profile
,
indices
,
mult
;
std
::
vector
<
med_int
>
profile
,
indices
;
if
(
_type
==
NodeData
){
for
(
int
i
=
0
;
i
<
_steps
[
0
]
->
getNumData
();
i
++
){
profileName
=
(
char
*
)
"nodeProfile"
;
if
(
_steps
[
0
]
->
getData
(
i
)){
for
(
int
i
=
0
;
i
<
_steps
[
0
]
->
getNumData
();
i
++
){
MVertex
*
v
=
_steps
[
0
]
->
getModel
()
->
getMeshVertexByTag
(
i
);
if
(
_steps
[
0
]
->
getData
(
i
)){
if
(
!
v
){
MVertex
*
v
=
_steps
[
0
]
->
getModel
()
->
getMeshVertexByTag
(
i
);
Msg
(
GERROR
,
"Unknown vertex %d in data"
,
i
);
if
(
!
v
){
return
false
;
Msg
(
GERROR
,
"Unknown vertex %d in data"
,
i
);
return
false
;
}
profile
.
push_back
(
v
->
getIndex
());
indices
.
push_back
(
i
);
mult
.
push_back
(
1
);
}
}
}
else
{
// FIXME: not tested
profileName
=
(
char
*
)
"elementProfile"
;
std
::
vector
<
MElement
*>
elements
;
int
offset
=
model
->
getNumVertices
();
for
(
int
i
=
0
;
i
<
_steps
[
0
]
->
getNumEntities
();
i
++
)
for
(
int
j
=
0
;
j
<
_steps
[
0
]
->
getEntity
(
i
)
->
getNumMeshElements
();
j
++
)
elements
.
push_back
(
_steps
[
0
]
->
getEntity
(
i
)
->
getMeshElement
(
j
));
for
(
int
i
=
0
;
i
<
_steps
[
0
]
->
getNumData
();
i
++
){
if
(
_steps
[
0
]
->
getData
(
i
)){
int
idx
=
i
-
offset
;
if
(
idx
<
0
||
idx
>=
elements
.
size
()){
Msg
(
GERROR
,
"Unknown element %d in data"
,
idx
);
return
false
;
}
MElement
*
e
=
elements
[
idx
];
profile
.
push_back
(
idx
);
indices
.
push_back
(
i
);
if
(
_type
==
GaussPointData
)
mult
.
push_back
(
_steps
[
0
]
->
getGaussPoints
(
e
->
getTypeForMSH
()).
size
()
/
3
);
else
mult
.
push_back
(
e
->
getNumVertices
());
}
}
profile
.
push_back
(
v
->
getIndex
());
indices
.
push_back
(
i
);
}
}
}
}
if
(
profile
.
empty
()){
if
(
profile
.
empty
()){
Msg
(
GERROR
,
"Nothing to save"
);
Msg
(
GERROR
,
"Nothing to save"
);
return
false
;
return
false
;
...
@@ -467,14 +440,12 @@ bool PViewDataGModel::writeMED(std::string fileName)
...
@@ -467,14 +440,12 @@ bool PViewDataGModel::writeMED(std::string fileName)
return
false
;
return
false
;
}
}
// FIXME: generalize following for all _types
med_int
numNodes
=
MEDnEntMaa
(
fid
,
meshName
,
MED_COOR
,
MED_NOEUD
,
med_int
numNodes
=
MEDnEntMaa
(
fid
,
meshName
,
MED_COOR
,
MED_NOEUD
,
MED_NONE
,
(
med_connectivite
)
0
);
MED_NONE
,
(
med_connectivite
)
0
);
if
(
numNodes
<=
0
){
if
(
numNodes
<=
0
){
Msg
(
GERROR
,
"Could not get valid number of nodes in mesh"
);
Msg
(
GERROR
,
"Could not get valid number of nodes in mesh"
);
return
false
;
return
false
;
}
}
for
(
unsigned
int
step
=
0
;
step
<
_steps
.
size
();
step
++
){
for
(
unsigned
int
step
=
0
;
step
<
_steps
.
size
();
step
++
){
unsigned
int
n
=
0
;
unsigned
int
n
=
0
;
for
(
int
i
=
0
;
i
<
_steps
[
step
]
->
getNumData
();
i
++
)
for
(
int
i
=
0
;
i
<
_steps
[
step
]
->
getNumData
();
i
++
)
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataIO.cpp
+
19
−
1
View file @
8484b79f
// $Id: PViewDataIO.cpp,v 1.
7
2008-0
3-29 10:19:43
geuzaine Exp $
// $Id: PViewDataIO.cpp,v 1.
8
2008-0
4-02 20:00:38
geuzaine Exp $
//
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -116,3 +116,21 @@ bool PViewData::writeTXT(std::string fileName)
...
@@ -116,3 +116,21 @@ bool PViewData::writeTXT(std::string fileName)
fclose
(
fp
);
fclose
(
fp
);
return
true
;
return
true
;
}
}
bool
PViewData
::
writePOS
(
std
::
string
fileName
,
bool
binary
,
bool
parsed
,
bool
append
)
{
Msg
(
GERROR
,
"POS export not implemented for this view type"
);
return
false
;
}
bool
PViewData
::
writeMSH
(
std
::
string
fileName
,
bool
binary
)
{
Msg
(
GERROR
,
"MSH export not implemented for this view type"
);
return
false
;
}
bool
PViewData
::
writeMED
(
std
::
string
fileName
)
{
Msg
(
GERROR
,
"MED export not implemented for this view type"
);
return
false
;
}
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