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
02858ad6
Commit
02858ad6
authored
12 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
reduce memory overhead of empty steps in model-based views
(best solution would be not to allocate empty steps at all -- todo...)
parent
33a62fca
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/PViewDataGModel.h
+6
-5
6 additions, 5 deletions
Post/PViewDataGModel.h
Post/PViewDataGModelIO.cpp
+14
-14
14 additions, 14 deletions
Post/PViewDataGModelIO.cpp
Post/PViewIO.cpp
+1
-1
1 addition, 1 deletion
Post/PViewIO.cpp
with
21 additions
and
20 deletions
Post/PViewDataGModel.h
+
6
−
5
View file @
02858ad6
...
...
@@ -51,8 +51,6 @@ class stepData{
:
_model
(
model
),
_fileName
(
fileName
),
_fileIndex
(
fileIndex
),
_time
(
time
),
_min
(
min
),
_max
(
max
),
_numComp
(
numComp
),
_data
(
0
)
{
_model
->
getEntities
(
_entities
);
_bbox
=
_model
->
bounds
();
}
stepData
(
stepData
<
real
>
&
other
)
:
_data
(
0
)
{
...
...
@@ -82,6 +80,8 @@ class stepData{
_partitions
=
other
.
_partitions
;
}
~
stepData
(){
destroyData
();
}
void
fillEntities
(){
_model
->
getEntities
(
_entities
);
}
void
computeBoundingBox
(){
_bbox
=
_model
->
bounds
();
}
GModel
*
getModel
(){
return
_model
;
}
SBoundingBox3d
getBoundingBox
(){
return
_bbox
;
}
int
getNumEntities
(){
return
_entities
.
size
();
}
...
...
@@ -235,9 +235,10 @@ class PViewDataGModel : public PViewData {
int
step
,
double
time
,
int
partition
,
int
numComp
);
// I/O routines
bool
readMSH
(
const
std
::
string
&
fileName
,
int
fileIndex
,
FILE
*
fp
,
bool
binary
,
bool
swap
,
int
step
,
double
time
,
int
partition
,
int
numComp
,
int
numNodes
,
const
std
::
string
&
interpolationScheme
);
bool
readMSH
(
const
std
::
string
&
viewName
,
const
std
::
string
&
fileName
,
int
fileIndex
,
FILE
*
fp
,
bool
binary
,
bool
swap
,
int
step
,
double
time
,
int
partition
,
int
numComp
,
int
numNodes
,
const
std
::
string
&
interpolationScheme
);
bool
writeMSH
(
const
std
::
string
&
fileName
,
bool
binary
=
false
,
bool
savemesh
=
true
);
bool
readMED
(
const
std
::
string
&
fileName
,
int
fileIndex
);
bool
writeMED
(
const
std
::
string
&
fileName
);
...
...
This diff is collapsed.
Click to expand it.
Post/PViewDataGModelIO.cpp
+
14
−
14
View file @
02858ad6
...
...
@@ -25,7 +25,8 @@ bool PViewDataGModel::addData(GModel *model, std::map<int, std::vector<double> >
while
(
step
>=
(
int
)
_steps
.
size
())
_steps
.
push_back
(
new
stepData
<
double
>
(
model
,
numComp
));
_steps
[
step
]
->
fillEntities
();
_steps
[
step
]
->
computeBoundingBox
();
_steps
[
step
]
->
setTime
(
time
);
int
numEnt
=
(
_type
==
NodeData
)
?
model
->
getNumMeshVertices
()
:
...
...
@@ -45,21 +46,18 @@ bool PViewDataGModel::addData(GModel *model, std::map<int, std::vector<double> >
return
true
;
}
bool
PViewDataGModel
::
readMSH
(
const
std
::
string
&
file
Name
,
int
fileIndex
,
FILE
*
fp
,
bool
binary
,
bool
swap
,
int
step
,
double
time
,
int
partition
,
int
numComp
,
int
numEnt
,
const
std
::
string
&
interpolationScheme
)
bool
PViewDataGModel
::
readMSH
(
const
std
::
string
&
view
Name
,
const
std
::
string
&
fileName
,
int
fileIndex
,
FILE
*
fp
,
bool
binary
,
bool
swap
,
int
step
,
double
time
,
int
partition
,
int
numComp
,
int
numEnt
,
const
std
::
string
&
interpolationScheme
)
{
Msg
::
Info
(
"Reading step %d (time %g) partition %d: %d records"
,
step
,
time
,
partition
,
numEnt
);
while
(
step
>=
(
int
)
_steps
.
size
()){
if
(
_steps
.
empty
()
||
_steps
.
back
()
->
getNumData
())
_steps
.
push_back
(
new
stepData
<
double
>
(
GModel
::
current
(),
numComp
));
else
// faster since we avoid computing model bounds
_steps
.
push_back
(
new
stepData
<
double
>
(
*
_steps
.
back
()));
}
Msg
::
Info
(
"Reading view `%s' step %d (time %g) partition %d: %d records"
,
viewName
.
c_str
(),
step
,
time
,
partition
,
numEnt
);
while
(
step
>=
(
int
)
_steps
.
size
())
_steps
.
push_back
(
new
stepData
<
double
>
(
GModel
::
current
(),
numComp
));
_steps
[
step
]
->
fillEntities
();
_steps
[
step
]
->
computeBoundingBox
();
_steps
[
step
]
->
setFileName
(
fileName
);
_steps
[
step
]
->
setFileIndex
(
fileIndex
);
_steps
[
step
]
->
setTime
(
time
);
...
...
@@ -423,6 +421,8 @@ bool PViewDataGModel::readMED(const std::string &fileName, int fileIndex)
}
while
(
step
>=
(
int
)
_steps
.
size
())
_steps
.
push_back
(
new
stepData
<
double
>
(
m
,
numCompMsh
));
_steps
[
step
]
->
fillEntities
();
_steps
[
step
]
->
computeBoundingBox
();
_steps
[
step
]
->
setFileName
(
fileName
);
_steps
[
step
]
->
setFileIndex
(
fileIndex
);
_steps
[
step
]
->
setTime
(
dt
);
...
...
This diff is collapsed.
Click to expand it.
Post/PViewIO.cpp
+
1
−
1
View file @
02858ad6
...
...
@@ -210,7 +210,7 @@ bool PView::readMSH(const std::string &fileName, int fileIndex)
if
(
p
)
d
=
dynamic_cast
<
PViewDataGModel
*>
(
p
->
getData
());
bool
create
=
d
?
false
:
true
;
if
(
create
)
d
=
new
PViewDataGModel
(
type
);
if
(
!
d
->
readMSH
(
fileName
,
fileIndex
,
fp
,
binary
,
swap
,
timeStep
,
if
(
!
d
->
readMSH
(
viewName
,
fileName
,
fileIndex
,
fp
,
binary
,
swap
,
timeStep
,
time
,
partition
,
numComp
,
numEnt
,
interpolationScheme
)){
Msg
::
Error
(
"Could not read data in msh file"
);
if
(
create
)
delete
d
;
...
...
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