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
83a8e0d0
Commit
83a8e0d0
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
bug fixes
parent
da5ff60b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Post/PViewDataGModel.cpp
+17
-13
17 additions, 13 deletions
Post/PViewDataGModel.cpp
Post/PViewDataGModelIO.cpp
+21
-5
21 additions, 5 deletions
Post/PViewDataGModelIO.cpp
with
38 additions
and
18 deletions
Post/PViewDataGModel.cpp
+
17
−
13
View file @
83a8e0d0
// $Id: PViewDataGModel.cpp,v 1.4
3
2008-03-31
16:04
:4
2
geuzaine Exp $
// $Id: PViewDataGModel.cpp,v 1.4
4
2008-03-31
21:12
:4
1
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -140,28 +140,32 @@ int PViewDataGModel::getDimension(int step, int ent, int ele)
int
PViewDataGModel
::
getNumNodes
(
int
step
,
int
ent
,
int
ele
)
{
// no sanity checks (assumed to be guarded by skipElement)
if
(
_type
==
GaussPointData
)
return
1
;
// FIXME!
if
(
_type
==
GaussPointData
){
return
1
;
// FIXME
}
else
{
return
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
)
->
getNumVertices
();
//return _steps[step]->getEntity(ent)->getMeshElement(ele)->getNumPrimaryVertices();
}
}
void
PViewDataGModel
::
getNode
(
int
step
,
int
ent
,
int
ele
,
int
nod
,
double
&
x
,
double
&
y
,
double
&
z
)
{
if
(
_type
==
GaussPointData
){
// FIXME!
// no sanity checks (assumed to be guarded by skipElement)
if
(
_type
==
GaussPointData
){
// FIXME
MElement
*
e
=
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
SPoint3
bc
=
e
->
barycenter
();
x
=
bc
.
x
();
y
=
bc
.
y
();
z
=
bc
.
z
();
return
;
}
// no sanity checks (assumed to be guarded by skipElement)
else
{
MVertex
*
v
=
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
)
->
getVertex
(
nod
);
x
=
v
->
x
();
y
=
v
->
y
();
z
=
v
->
z
();
}
}
int
PViewDataGModel
::
getNumComponents
(
int
step
,
int
ent
,
int
ele
)
{
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModelIO.cpp
+
21
−
5
View file @
83a8e0d0
// $Id: PViewDataGModelIO.cpp,v 1.
29
2008-03-31
16:04
:4
2
geuzaine Exp $
// $Id: PViewDataGModelIO.cpp,v 1.
30
2008-03-31
21:12
:4
1
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -175,6 +175,8 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
Msg
(
INFO
,
"Reading %d-component field <<%s>>"
,
numComp
,
name
);
setName
(
name
);
int
numCompMsh
=
(
numComp
==
1
)
?
1
:
(
numComp
<
3
)
?
3
:
9
;
// the ordering of the elements in the following lists is important:
// it should match the ordering of the MSH element types (when
// elements are saved without tags, this governs the order with
...
...
@@ -236,7 +238,6 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
Msg
(
GERROR
,
"Could not find mesh <<%s>>"
,
meshName
);
return
false
;
}
int
numCompMsh
=
(
numComp
==
1
)
?
1
:
(
numComp
<
3
)
?
3
:
9
;
while
(
step
>=
(
int
)
_steps
.
size
())
_steps
.
push_back
(
new
stepData
<
double
>
(
m
,
numCompMsh
));
_steps
[
step
]
->
setFileName
(
fileName
);
...
...
@@ -254,7 +255,7 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
if
(
ent
==
MED_NOEUD_ELEMENT
){
mult
=
nodesPerEle
[
pairs
[
pair
].
second
];
}
else
if
(
ngauss
>
1
){
else
if
(
ngauss
!=
MED_NOPG
){
mult
=
ngauss
;
setType
(
GaussPointData
);
}
...
...
@@ -272,6 +273,21 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
return
false
;
}
// read Gauss point data
if
(
ngauss
!=
MED_NOPG
){
std
::
vector
<
med_float
>
refcoo
((
ele
%
100
)
*
(
ele
/
100
));
std
::
vector
<
med_float
>
gscoo
(
ngauss
*
ele
/
100
);
std
::
vector
<
med_float
>
wg
(
ngauss
);
if
(
MEDgaussLire
(
fid
,
&
refcoo
[
0
],
&
gscoo
[
0
],
&
wg
[
0
],
MED_FULL_INTERLACE
,
locname
)
<
0
){
Msg
(
GERROR
,
"Could not read Gauss points"
);
return
false
;
}
// FIXME: store this in stepData, e.g. in a vector indexed by
// mshEleType std::vector<std::vector<u,v,w, u,v,w, u,v,w, ...> >
// (ele/100==geo dim, ele%100==num nodes)
}
// compute profile (indices in full array of entities of given type)
std
::
vector
<
med_int
>
profile
;
if
(
std
::
string
(
profileName
)
!=
MED_NOPFL
){
...
...
@@ -331,8 +347,8 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
// reorder nodes if we have ElementNode data
int
j2
=
(
ent
==
MED_NOEUD_ELEMENT
)
?
med2msh
(
ele
,
j
)
:
j
;
for
(
int
k
=
0
;
k
<
numComp
;
k
++
)
d
[
numComp
*
j
+
k
]
=
val
[
numComp
*
mult
*
i
+
numComp
*
j2
+
k
];
double
s
=
ComputeScalarRep
(
_steps
[
step
]
->
getNumComponents
()
,
&
d
[
numComp
*
j
]);
d
[
numComp
Msh
*
j
+
k
]
=
val
[
numComp
*
mult
*
i
+
numComp
*
j2
+
k
];
double
s
=
ComputeScalarRep
(
numCompMsh
,
&
d
[
numComp
Msh
*
j
]);
_steps
[
step
]
->
setMin
(
std
::
min
(
_steps
[
step
]
->
getMin
(),
s
));
_steps
[
step
]
->
setMax
(
std
::
max
(
_steps
[
step
]
->
getMax
(),
s
));
}
...
...
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