Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
aa871e37
Commit
aa871e37
authored
May 12, 2020
by
Müller, Felix
Browse files
Move initial refine/loadbalance to MeshCreator
parent
ad86d17a
Changes
2
Hide whitespace changes
Inline
Side-by-side
amdis/MeshCreator.hpp
View file @
aa871e37
...
...
@@ -86,6 +86,15 @@ namespace AMDiS
// decide by inspecting the grid type how to create the grid
gridPtr
=
create_by_gridtype
<
HostGrid
>
(
Dune
::
PriorityTag
<
42
>
{});
}
// Perform initial refinement and load balance if requested in the initfile
auto
globalRefinements
=
Parameters
::
get
<
int
>
(
name_
+
"->global refinements"
);
if
(
globalRefinements
)
gridPtr
->
globalRefine
(
globalRefinements
.
value
());
auto
loadBalance
=
Parameters
::
get
<
bool
>
(
name_
+
"->load balance"
);
if
(
loadBalance
&&
loadBalance
.
value
())
gridPtr
->
loadBalance
();
return
construct
(
std
::
move
(
gridPtr
));
}
...
...
amdis/ProblemStat.inc.hpp
View file @
aa871e37
...
...
@@ -47,21 +47,6 @@ void ProblemStat<Traits>::initialize(
if
(
!
grid_
)
warning
(
"no grid created"
);
if
(
initFlag
.
isSet
(
INIT_MESH
))
{
int
globalRefinements
=
0
;
Parameters
::
get
(
gridName_
+
"->global refinements"
,
globalRefinements
);
if
(
globalRefinements
>
0
)
grid_
->
globalRefine
(
globalRefinements
);
bool
loadBalance
=
false
;
Parameters
::
get
(
gridName_
+
"->load balance"
,
loadBalance
);
if
(
loadBalance
)
loadBalance
=
grid_
->
loadBalance
();
if
(
globalBasis_
&&
(
globalRefinements
>
0
||
loadBalance
))
globalBasis_
->
update
(
globalBasis_
->
gridView
());
}
// create fespace
if
(
globalBasis_
)
{
warning
(
"globalBasis already created"
);
...
...
@@ -180,11 +165,6 @@ void ProblemStat<Traits>::createGrid()
MeshCreator
<
Grid
>
creator
(
gridName_
);
grid_
=
creator
.
create
();
Dune
::
Timer
t
;
bool
loadBalance
=
grid_
->
loadBalance
();
if
(
loadBalance
)
info
(
2
,
"load balance needed {} seconds"
,
t
.
elapsed
());
boundaryManager_
=
std
::
make_shared
<
BoundaryManager
<
Grid
>>
(
grid_
);
if
(
!
creator
.
boundaryIds
().
empty
())
boundaryManager_
->
setBoundaryIds
(
creator
.
boundaryIds
());
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment