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
580dd170
Commit
580dd170
authored
Feb 15, 2019
by
Praetorius, Simon
Browse files
Merge branch 'develop' of gitlab.mn.tu-dresden.de:spraetor/dune-amdis into develop
parents
b356d05e
65eb4061
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/amdis/ProblemInstatBase.hpp
View file @
580dd170
...
...
@@ -58,6 +58,18 @@ namespace AMDiS
return
0
;
}
/// Implementation of \ref ProblemStatBase::globalCoarsen().
virtual
Flag
globalCoarsen
(
int
n
)
override
{
return
0
;
}
/// Implementation of \ref ProblemStatBase::globalRefine().
virtual
Flag
globalRefine
(
int
n
)
override
{
return
0
;
}
/// Implementation of \ref ProblemTimeInterface::closeTimestep().
virtual
void
closeTimestep
(
AdaptInfo
&
)
override
{
/* do nothing */
}
...
...
src/amdis/ProblemStat.hpp
View file @
580dd170
...
...
@@ -429,6 +429,11 @@ namespace AMDiS
/// Implementation of \ref ProblemStatBase::markElements.
virtual
Flag
markElements
(
AdaptInfo
&
adaptInfo
)
override
;
/// Uniform global grid coarsening by up to n level
virtual
Flag
globalCoarsen
(
int
n
)
override
;
/// Uniform global refinement by n level
virtual
Flag
globalRefine
(
int
n
)
override
;
private:
/// Name of this problem.
...
...
src/amdis/ProblemStat.inc.hpp
View file @
580dd170
...
...
@@ -354,6 +354,57 @@ markElements(AdaptInfo& adaptInfo)
}
template
<
class
Traits
>
Flag
ProblemStat
<
Traits
>::
globalCoarsen
(
int
n
)
{
Dune
::
Timer
t
;
bool
adapted
=
false
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
// mark all entities for grid refinement
for
(
const
auto
&
element
:
elements
(
grid_
->
leafGridView
()))
grid_
->
mark
(
-
1
,
element
);
adapted
|=
GridTransferManager
::
adapt
(
*
grid_
);
globalBasis_
->
update
(
gridView
());
}
msg
(
"globalCoarsen needed {} seconds"
,
t
.
elapsed
());
return
adapted
?
MESH_ADAPTED
:
Flag
(
0
);
}
// grid has globalRefine(int, AdaptDataHandleInterface&)
template
<
class
G
>
using
HasGlobalRefineADHI
=
decltype
(
std
::
declval
<
G
>
().
globalRefine
(
1
,
std
::
declval
<
GridTransfer
<
G
>&>
()));
template
<
class
Traits
>
Flag
ProblemStat
<
Traits
>::
globalRefine
(
int
refCount
)
{
Dune
::
Timer
t
;
bool
adapted
=
false
;
Dune
::
Hybrid
::
ifElse
(
Dune
::
Std
::
is_detected
<
HasGlobalRefineADHI
,
Grid
>
{},
/*then*/
[
&
](
auto
id
)
{
id
(
grid_
)
->
globalRefine
(
refCount
,
GridTransferManager
::
gridTransfer
(
*
grid_
));
globalBasis_
->
update
(
this
->
gridView
());
},
/*else*/
[
&
](
auto
id
)
{
for
(
int
i
=
0
;
i
<
refCount
;
++
i
)
{
// mark all entities for grid refinement
for
(
const
auto
&
element
:
elements
(
grid_
->
leafGridView
()))
grid_
->
mark
(
1
,
element
);
adapted
|=
GridTransferManager
::
adapt
(
*
id
(
grid_
));
globalBasis_
->
update
(
this
->
gridView
());
}
});
msg
(
"globalRefine needed {} seconds"
,
t
.
elapsed
());
return
adapted
?
MESH_ADAPTED
:
Flag
(
0
);
}
template
<
class
Traits
>
Flag
ProblemStat
<
Traits
>::
adaptGrid
(
AdaptInfo
&
adaptInfo
)
...
...
src/amdis/ProblemStatBase.hpp
View file @
580dd170
...
...
@@ -74,6 +74,14 @@ namespace AMDiS
/// Refinement/coarsening of the grid.
virtual
Flag
adaptGrid
(
AdaptInfo
&
adaptInfo
)
=
0
;
/// Uniform global grid coarsening by up to n level.
/// Returns MESH_ADAPTED if grid was changed
virtual
Flag
globalCoarsen
(
int
n
)
=
0
;
/// Uniform global refinement by n level
/// Returns MESH_ADAPTED if grid was changed
virtual
Flag
globalRefine
(
int
n
)
=
0
;
/** \brief
* Solves the assembled system. The result is an approximative solution.
* The last two boolean arguments can be used to controll successive
...
...
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