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
fb6bee2a
Commit
fb6bee2a
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
MED Gauss points
parent
940c2f40
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Post/PViewDataGModel.cpp
+25
-9
25 additions, 9 deletions
Post/PViewDataGModel.cpp
Post/PViewDataGModel.h
+8
-0
8 additions, 0 deletions
Post/PViewDataGModel.h
Post/PViewDataGModelIO.cpp
+24
-16
24 additions, 16 deletions
Post/PViewDataGModelIO.cpp
with
57 additions
and
25 deletions
Post/PViewDataGModel.cpp
+
25
−
9
View file @
fb6bee2a
// $Id: PViewDataGModel.cpp,v 1.4
4
2008-0
3-31 21:12:41
geuzaine Exp $
// $Id: PViewDataGModel.cpp,v 1.4
5
2008-0
4-01 18:20:02
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -140,12 +140,13 @@ 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)
MElement
*
e
=
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
if
(
_type
==
GaussPointData
){
return
1
;
// FIXME
return
_steps
[
step
]
->
getGaussPoints
(
e
->
getTypeForMSH
()).
size
()
/
3
;
}
else
{
return
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
)
->
getNumVertices
();
//
return
_steps[step]->getEntity(ent)->getMeshElement(ele)
->getNumPrimaryVertices();
//
return
e
->getNumVertices();
return
e
->
getNumPrimaryVertices
();
}
}
...
...
@@ -153,14 +154,29 @@ void PViewDataGModel::getNode(int step, int ent, int ele, int nod,
double
&
x
,
double
&
y
,
double
&
z
)
{
// no sanity checks (assumed to be guarded by skipElement)
MElement
*
e
=
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
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
();
std
::
vector
<
double
>
&
p
(
_steps
[
step
]
->
getGaussPoints
(
e
->
getTypeForMSH
()));
if
(
p
[
0
]
==
1.e22
){
// hack: the points are the element vertices
x
=
e
->
getVertex
(
nod
)
->
x
();
y
=
e
->
getVertex
(
nod
)
->
y
();
z
=
e
->
getVertex
(
nod
)
->
z
();
}
else
{
double
vx
[
8
],
vy
[
8
],
vz
[
8
];
for
(
int
i
=
0
;
i
<
e
->
getNumPrimaryVertices
();
i
++
){
vx
[
i
]
=
e
->
getVertex
(
i
)
->
x
();
vy
[
i
]
=
e
->
getVertex
(
i
)
->
y
();
vz
[
i
]
=
e
->
getVertex
(
i
)
->
z
();
}
x
=
e
->
interpolate
(
vx
,
p
[
3
*
nod
],
p
[
3
*
nod
+
1
],
p
[
3
*
nod
+
2
]);
y
=
e
->
interpolate
(
vy
,
p
[
3
*
nod
],
p
[
3
*
nod
+
1
],
p
[
3
*
nod
+
2
]);
z
=
e
->
interpolate
(
vz
,
p
[
3
*
nod
],
p
[
3
*
nod
+
1
],
p
[
3
*
nod
+
2
]);
}
}
else
{
MVertex
*
v
=
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
)
->
getVertex
(
nod
);
MVertex
*
v
=
e
->
getVertex
(
nod
);
x
=
v
->
x
();
y
=
v
->
y
();
z
=
v
->
z
();
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModel.h
+
8
−
0
View file @
fb6bee2a
...
...
@@ -50,6 +50,9 @@ class stepData{
// the data and 2) not to store any additional info in MVertex or
// MElement)
std
::
vector
<
real
*>
*
_data
;
// a vector, indexed by MSH element type, of Gauss point locations
// in parametric space
std
::
vector
<
std
::
vector
<
double
>
>
_gaussPoints
;
public:
stepData
(
GModel
*
model
,
int
numComp
,
std
::
string
fileName
=
""
,
int
fileIndex
=-
1
,
double
time
=
0.
,
double
min
=
VAL_INF
,
double
max
=-
VAL_INF
)
...
...
@@ -114,6 +117,11 @@ class stepData{
_data
=
0
;
}
}
std
::
vector
<
double
>
&
getGaussPoints
(
int
msh
)
{
if
(
_gaussPoints
.
size
()
<=
msh
)
_gaussPoints
.
resize
(
msh
+
1
);
return
_gaussPoints
[
msh
];
}
};
// data container using elements from a GModel
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModelIO.cpp
+
24
−
16
View file @
fb6bee2a
// $Id: PViewDataGModelIO.cpp,v 1.3
3
2008-04-01 1
3:41:33
geuzaine Exp $
// $Id: PViewDataGModelIO.cpp,v 1.3
4
2008-04-01 1
8:20:02
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -275,22 +275,30 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
return
false
;
}
// read Gauss point data (if locname is MED_GAUSS_ELNO, the
// points are the element vertices)
if
(
_type
==
GaussPointData
&&
std
::
string
(
locname
)
!=
MED_GAUSS_ELNO
){
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
;
// read Gauss point data
if
(
_type
==
GaussPointData
){
std
::
vector
<
double
>
&
p
(
_steps
[
step
]
->
getGaussPoints
(
med2mshElementType
(
ele
)));
if
(
std
::
string
(
locname
)
==
MED_GAUSS_ELNO
){
// hack: the points are the vertices
p
.
resize
(
ngauss
*
3
,
1.e22
);
}
else
{
int
dim
=
ele
/
100
;
std
::
vector
<
med_float
>
refcoo
((
ele
%
100
)
*
dim
);
std
::
vector
<
med_float
>
gscoo
(
ngauss
*
dim
);
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
;
}
// we should check that refcoo corresponds to our internal
// reference element
for
(
unsigned
int
i
=
0
;
i
<
gscoo
.
size
();
i
++
){
p
.
push_back
(
gscoo
[
i
]);
if
(
i
%
dim
==
dim
-
1
)
for
(
int
j
=
0
;
j
<
3
-
dim
;
j
++
)
p
.
push_back
(
0.
);
}
}
// 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)
// int msh = med2mshElementTupe(ele);
// gaussPointsCoordinates[msh] = gscoo; // zero pad
}
// compute profile (indices in full array of entities of given type)
...
...
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