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
85b69d0a
Commit
85b69d0a
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fixes for ElementNodeData
parent
c4531470
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Post/OctreePost.cpp
+2
-2
2 additions, 2 deletions
Post/OctreePost.cpp
Post/PViewDataGModel.cpp
+21
-25
21 additions, 25 deletions
Post/PViewDataGModel.cpp
Post/PViewDataGModel.h
+1
-1
1 addition, 1 deletion
Post/PViewDataGModel.h
with
24 additions
and
28 deletions
Post/OctreePost.cpp
+
2
−
2
View file @
85b69d0a
// $Id: OctreePost.cpp,v 1.1
0
2008-0
3-30
1
5
:3
7:42
geuzaine Exp $
// $Id: OctreePost.cpp,v 1.1
1
2008-0
4-02
1
6
:3
0:29
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -435,7 +435,7 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep, doub
if
(
timestep
<
0
||
step
==
timestep
){
for
(
int
nod
=
0
;
nod
<
e
->
getNumVertices
();
nod
++
){
for
(
int
comp
=
0
;
comp
<
nbComp
;
comp
++
){
if
(
!
_theViewDataGModel
->
getValue
(
step
,
dataIndex
[
nod
],
comp
,
if
(
!
_theViewDataGModel
->
getValue
(
step
,
dataIndex
[
nod
],
nod
,
comp
,
nodeval
[
nod
*
nbComp
+
comp
]))
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModel.cpp
+
21
−
25
View file @
85b69d0a
// $Id: PViewDataGModel.cpp,v 1.4
5
2008-04-0
1
1
8:20:02
geuzaine Exp $
// $Id: PViewDataGModel.cpp,v 1.4
6
2008-04-0
2
1
6:30:29
geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -193,27 +193,19 @@ void PViewDataGModel::getValue(int step, int ent, int ele, int nod, int comp, do
{
// no sanity checks (assumed to be guarded by skipElement)
stepData
<
double
>
*
sd
=
_steps
[
step
];
MElement
*
e
=
sd
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
switch
(
_type
){
case
NodeData
:
{
MVertex
*
v
=
sd
->
getEntity
(
ent
)
->
getMeshElement
(
ele
)
->
getVertex
(
nod
);
val
=
sd
->
getData
(
v
->
getNum
())[
comp
];
break
;
}
val
=
sd
->
getData
(
e
->
getVertex
(
nod
)
->
getNum
())[
comp
];
break
;
case
ElementNodeData
:
case
GaussPointData
:
{
MElement
*
e
=
sd
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
val
=
sd
->
getData
(
e
->
getNum
())[
sd
->
getNumComponents
()
*
nod
+
comp
];
break
;
}
val
=
sd
->
getData
(
e
->
getNum
())[
sd
->
getNumComponents
()
*
nod
+
comp
];
break
;
case
ElementData
:
default:
{
MElement
*
e
=
sd
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
val
=
sd
->
getData
(
e
->
getNum
())[
comp
];
break
;
}
val
=
sd
->
getData
(
e
->
getNum
())[
comp
];
break
;
}
}
...
...
@@ -225,7 +217,7 @@ int PViewDataGModel::getNumEdges(int step, int ent, int ele)
void
PViewDataGModel
::
smooth
()
{
if
(
_type
==
NodeData
)
return
;
if
(
_type
==
NodeData
||
_type
==
GaussPointData
)
return
;
std
::
vector
<
stepData
<
double
>*>
_steps2
;
for
(
unsigned
int
step
=
0
;
step
<
_steps
.
size
();
step
++
){
GModel
*
m
=
_steps
[
step
]
->
getModel
();
...
...
@@ -237,7 +229,7 @@ void PViewDataGModel::smooth()
for
(
int
ele
=
0
;
ele
<
getNumElements
(
step
,
ent
);
ele
++
){
MElement
*
e
=
_steps
[
step
]
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
double
val
;
if
(
!
getValue
(
step
,
e
->
getNum
(),
0
,
val
))
continue
;
if
(
!
getValue
(
step
,
e
->
getNum
(),
0
,
0
,
val
))
continue
;
for
(
int
nod
=
0
;
nod
<
e
->
getNumVertices
();
nod
++
){
MVertex
*
v
=
e
->
getVertex
(
nod
);
if
(
nodeConnect
.
count
(
v
->
getNum
()))
...
...
@@ -246,7 +238,7 @@ void PViewDataGModel::smooth()
nodeConnect
[
v
->
getNum
()]
=
1
;
double
*
d
=
_steps2
.
back
()
->
getData
(
v
->
getNum
(),
true
);
for
(
int
j
=
0
;
j
<
numComp
;
j
++
)
if
(
getValue
(
step
,
e
->
getNum
(),
j
,
val
))
d
[
j
]
+=
val
;
if
(
getValue
(
step
,
e
->
getNum
(),
nod
,
j
,
val
))
d
[
j
]
+=
val
;
}
}
}
...
...
@@ -275,16 +267,16 @@ bool PViewDataGModel::skipEntity(int step, int ent)
bool
PViewDataGModel
::
skipElement
(
int
step
,
int
ent
,
int
ele
)
{
if
(
step
>=
getNumTimeSteps
())
return
true
;
stepData
<
double
>
*
d
ata
=
_steps
[
step
];
stepData
<
double
>
*
s
d
=
_steps
[
step
];
if
(
!
_steps
[
step
]
->
getNumData
())
return
true
;
MElement
*
e
=
d
ata
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
MElement
*
e
=
s
d
->
getEntity
(
ent
)
->
getMeshElement
(
ele
);
if
(
!
e
->
getVisibility
())
return
true
;
if
(
_type
==
NodeData
){
for
(
int
i
=
0
;
i
<
e
->
getNumVertices
();
i
++
)
if
(
!
d
ata
->
getData
(
e
->
getVertex
(
i
)
->
getNum
()))
return
true
;
if
(
!
s
d
->
getData
(
e
->
getVertex
(
i
)
->
getNum
()))
return
true
;
}
else
{
if
(
!
d
ata
->
getData
(
e
->
getNum
()))
return
true
;
if
(
!
s
d
->
getData
(
e
->
getNum
()))
return
true
;
}
return
false
;
}
...
...
@@ -314,10 +306,14 @@ GEntity *PViewDataGModel::getEntity(int step, int ent)
return
_steps
[
step
]
->
getEntity
(
ent
);
}
bool
PViewDataGModel
::
getValue
(
int
step
,
int
dataIndex
,
int
comp
,
double
&
val
)
bool
PViewDataGModel
::
getValue
(
int
step
,
int
dataIndex
,
int
nod
,
int
comp
,
double
&
val
)
{
double
*
d
=
_steps
[
step
]
->
getData
(
dataIndex
);
if
(
!
d
)
return
false
;
val
=
d
[
comp
];
if
(
_type
==
NodeData
||
_type
==
ElementData
)
val
=
d
[
comp
];
else
val
=
d
[
_steps
[
step
]
->
getNumComponents
()
*
nod
+
comp
];
return
true
;
}
This diff is collapsed.
Click to expand it.
Post/PViewDataGModel.h
+
1
−
1
View file @
85b69d0a
...
...
@@ -176,7 +176,7 @@ class PViewDataGModel : public PViewData {
// direct access to GModel entities
GEntity
*
getEntity
(
int
step
,
int
ent
);
// direct access to value by index
bool
getValue
(
int
step
,
int
dataIndex
,
int
comp
,
double
&
val
);
bool
getValue
(
int
step
,
int
dataIndex
,
int
node
,
int
comp
,
double
&
val
);
// I/O routines
bool
readMSH
(
std
::
string
fileName
,
int
fileIndex
,
FILE
*
fp
,
bool
binary
,
...
...
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