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
b46188c9
Commit
b46188c9
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
better combineTime
parent
11b3db15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Post/PViewDataGModel.cpp
+6
-27
6 additions, 27 deletions
Post/PViewDataGModel.cpp
Post/PViewDataGModel.h
+41
-0
41 additions, 0 deletions
Post/PViewDataGModel.h
with
47 additions
and
27 deletions
Post/PViewDataGModel.cpp
+
6
−
27
View file @
b46188c9
...
@@ -515,33 +515,12 @@ bool PViewDataGModel::combineTime(nameData &nd)
...
@@ -515,33 +515,12 @@ bool PViewDataGModel::combineTime(nameData &nd)
for
(
unsigned
int
i
=
0
;
i
<
it
->
second
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
it
->
second
.
size
();
i
++
)
_interpolation
[
it
->
first
].
push_back
(
new
fullMatrix
<
double
>
(
*
it
->
second
[
i
]));
_interpolation
[
it
->
first
].
push_back
(
new
fullMatrix
<
double
>
(
*
it
->
second
[
i
]));
for
(
unsigned
int
i
=
0
;
i
<
data
.
size
();
i
++
){
// (deep) copy step data
// FIXME: this is a horrible hack (we copy the data twice, and use
for
(
unsigned
int
i
=
0
;
i
<
data
.
size
();
i
++
)
// a map!); we need to store the number of values per
for
(
unsigned
int
j
=
0
;
j
<
data
[
i
]
->
_steps
.
size
();
j
++
)
// node/ele/... in stepData and provide a copy constructor, then
if
(
data
[
i
]
->
hasTimeStep
(
j
))
// just copy the stepData
_steps
.
push_back
(
new
stepData
<
double
>
(
*
data
[
i
]
->
_steps
[
j
]));
for
(
unsigned
int
j
=
0
;
j
<
data
[
i
]
->
_steps
.
size
();
j
++
){
if
(
data
[
i
]
->
hasTimeStep
(
j
)){
std
::
map
<
int
,
std
::
vector
<
double
>
>
datamap
;
if
(
getType
()
==
NodeData
){
stepData
<
double
>
*
sd
=
data
[
i
]
->
_steps
[
j
];
for
(
unsigned
int
k
=
0
;
k
<
sd
->
getNumData
();
k
++
){
double
*
d
=
sd
->
getData
(
k
);
if
(
d
){
for
(
int
l
=
0
;
l
<
sd
->
getNumComponents
();
l
++
){
datamap
[
k
].
push_back
(
d
[
l
]);
}
}
}
}
else
{
Msg
::
Error
(
"Combine time not ready for non nodal model-based datasets"
);
}
addData
(
data
[
i
]
->
getModel
(
j
),
datamap
,
i
,
data
[
i
]
->
getTime
(
j
),
0
,
-
1
);
}
}
}
std
::
string
tmp
;
std
::
string
tmp
;
if
(
nd
.
name
==
"__all__"
)
if
(
nd
.
name
==
"__all__"
)
tmp
=
"all"
;
tmp
=
"all"
;
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModel.h
+
41
−
0
View file @
b46188c9
...
@@ -35,6 +35,11 @@ class stepData{
...
@@ -35,6 +35,11 @@ class stepData{
// the data and 2) not to store any additional info in MVertex or
// the data and 2) not to store any additional info in MVertex or
// MElement)
// MElement)
std
::
vector
<
real
*>
*
_data
;
std
::
vector
<
real
*>
*
_data
;
// a vector containing the multiplying factor allowing to compute
// the number of values stored in _data for each index (number of
// values = getMult() * getNumComponents()). If _mult is empty, a
// default value of "1" is assumed
std
::
vector
<
int
>
_mult
;
// a vector, indexed by MSH element type, of Gauss point locations
// a vector, indexed by MSH element type, of Gauss point locations
// in parametric space
// in parametric space
std
::
vector
<
std
::
vector
<
double
>
>
_gaussPoints
;
std
::
vector
<
std
::
vector
<
double
>
>
_gaussPoints
;
...
@@ -49,12 +54,44 @@ class stepData{
...
@@ -49,12 +54,44 @@ class stepData{
_model
->
getEntities
(
_entities
);
_model
->
getEntities
(
_entities
);
_bbox
=
_model
->
bounds
();
_bbox
=
_model
->
bounds
();
}
}
stepData
(
stepData
<
real
>
&
other
)
:
_data
(
0
)
{
_model
=
other
.
_model
;
_entities
=
other
.
_entities
;
_bbox
=
other
.
_bbox
;
_fileName
=
other
.
_fileName
;
_fileIndex
=
other
.
_fileIndex
;
_time
=
other
.
_time
;
_min
=
other
.
_min
;
_max
=
other
.
_max
;
_numComp
=
other
.
_numComp
;
if
(
other
.
_data
){
int
n
=
other
.
getNumData
();
_data
=
new
std
::
vector
<
real
*>
(
n
,
(
real
*
)
0
);
for
(
int
i
=
0
;
i
<
n
;
i
++
){
real
*
d
=
other
.
getData
(
i
);
if
(
d
){
int
m
=
other
.
getMult
(
i
)
*
_numComp
;
(
*
_data
)[
i
]
=
new
real
[
m
];
for
(
int
j
=
0
;
j
<
m
;
j
++
)
(
*
_data
)[
i
][
j
]
=
d
[
j
];
}
}
}
_mult
=
other
.
_mult
;
_gaussPoints
=
other
.
_gaussPoints
;
_partitions
=
other
.
_partitions
;
}
~
stepData
(){
destroyData
();
}
~
stepData
(){
destroyData
();
}
GModel
*
getModel
(){
return
_model
;
}
GModel
*
getModel
(){
return
_model
;
}
SBoundingBox3d
getBoundingBox
(){
return
_bbox
;
}
SBoundingBox3d
getBoundingBox
(){
return
_bbox
;
}
int
getNumEntities
(){
return
_entities
.
size
();
}
int
getNumEntities
(){
return
_entities
.
size
();
}
GEntity
*
getEntity
(
int
ent
){
return
_entities
[
ent
];
}
GEntity
*
getEntity
(
int
ent
){
return
_entities
[
ent
];
}
int
getNumComponents
(){
return
_numComp
;
}
int
getNumComponents
(){
return
_numComp
;
}
int
getMult
(
int
index
)
{
if
(
index
<
0
||
index
>=
_mult
.
size
())
return
1
;
return
_mult
[
index
];
}
std
::
string
getFileName
(){
return
_fileName
;
}
std
::
string
getFileName
(){
return
_fileName
;
}
void
setFileName
(
std
::
string
name
){
_fileName
=
name
;
}
void
setFileName
(
std
::
string
name
){
_fileName
=
name
;
}
int
getFileIndex
(){
return
_fileIndex
;
}
int
getFileIndex
(){
return
_fileIndex
;
}
...
@@ -83,6 +120,10 @@ class stepData{
...
@@ -83,6 +120,10 @@ class stepData{
(
*
_data
)[
index
]
=
new
real
[
_numComp
*
mult
];
(
*
_data
)[
index
]
=
new
real
[
_numComp
*
mult
];
for
(
int
i
=
0
;
i
<
_numComp
*
mult
;
i
++
)
(
*
_data
)[
index
][
i
]
=
0.
;
for
(
int
i
=
0
;
i
<
_numComp
*
mult
;
i
++
)
(
*
_data
)[
index
][
i
]
=
0.
;
}
}
if
(
mult
>
1
){
if
(
index
>=
_mult
.
size
())
_mult
.
resize
(
index
+
100
,
1
);
// optimize this
_mult
[
index
]
=
mult
;
}
}
}
else
{
else
{
if
(
index
>=
getNumData
())
return
0
;
if
(
index
>=
getNumData
())
return
0
;
...
...
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