Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
8ce6847d
Commit
8ce6847d
authored
Oct 13, 2016
by
Dennis Gläser
Committed by
Timo Koch
Nov 23, 2016
Browse files
[mpfao][iavol] reserve memory beforehand
parent
f0ef6524
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh
View file @
8ce6847d
...
...
@@ -147,11 +147,17 @@ public:
// create local sub control entities from the seed
createLocalEntities_
(
seed
);
//
fill info on the dof stencil
//
reserve memory
const
auto
numLocalScvs
=
localScvs_
.
size
();
const
auto
numLocalScvfs
=
localScvfs_
.
size
();
const
auto
maxNumVolVars
=
numLocalScvs
+
numLocalScvfs
;
stencil_
.
reserve
(
numLocalScvs
);
volVarsStencil_
.
reserve
(
numLocalScvs
);
volVarsPositions_
.
reserve
(
numLocalScvs
);
volVarsStencil_
.
reserve
(
maxNumVolVars
);
volVarsPositions_
.
reserve
(
maxNumVolVars
);
dirichletFaceIndexSet_
.
reserve
(
numLocalScvfs
);
fluxFaceIndexSet_
.
reserve
(
numLocalScvfs
);
// fill info on the dof stencil
for
(
const
auto
&
localScv
:
localScvs_
)
{
const
auto
globalScvIdx
=
localScv
.
globalIndex
();
...
...
@@ -177,6 +183,13 @@ public:
fluxFaceIndexSet_
.
push_back
(
localScvfIdx
++
);
}
// shrink containers to actual size
volVarsStencil_
.
shrink_to_fit
();
volVarsPositions_
.
shrink_to_fit
();
dirichletFaceIndexSet_
.
shrink_to_fit
();
fluxFaceIndexSet_
.
shrink_to_fit
();
// initialize the neumann fluxes vector to zero
neumannFluxes_
=
DynamicVector
(
fluxFaceIndexSet_
.
size
(),
0.0
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment