Skip to content
GitLab
Menu
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
ab268c22
Commit
ab268c22
authored
Apr 29, 2018
by
Praetorius, Simon
Browse files
bugs due to missing problemStat.getNumComponents() corrected
parent
ae5eafb9
Changes
6
Hide whitespace changes
Inline
Side-by-side
examples/navier_stokes.cc
View file @
ab268c22
...
...
@@ -38,7 +38,7 @@ int main(int argc, char** argv)
Parameters
::
get
(
"stokes->density"
,
density
);
Parameters
::
get
(
"stokes->boundary velocity"
,
vel
);
AdaptInfo
adaptInfo
(
"adapt"
,
prob
.
getNumComponents
()
);
AdaptInfo
adaptInfo
(
"adapt"
);
// tree-paths for components
auto
_v
=
0
_c
;
...
...
examples/stokes0.cc
View file @
ab268c22
...
...
@@ -71,7 +71,7 @@ int main(int argc, char** argv)
prob
.
addDirichletBC
([](
auto
const
&
x
)
{
return
x
[
0
]
<
1.e-8
&&
x
[
1
]
<
1.e-8
;
},
_p
,
_p
,
0.0
);
AdaptInfo
adaptInfo
(
"adapt"
,
prob
.
getNumComponents
()
);
AdaptInfo
adaptInfo
(
"adapt"
);
// assemble and solve system
prob
.
buildAfterCoarsen
(
adaptInfo
,
Flag
(
0
));
...
...
examples/stokes1.cc
View file @
ab268c22
...
...
@@ -72,7 +72,7 @@ int main(int argc, char** argv)
prob
.
addDirichletBC
([](
auto
const
&
x
)
{
return
x
[
0
]
<
1.e-8
&&
x
[
1
]
<
1.e-8
;
},
_p
,
_p
,
0.0
);
AdaptInfo
adaptInfo
(
"adapt"
,
prob
.
getNumComponents
()
);
AdaptInfo
adaptInfo
(
"adapt"
);
// assemble and solve system
prob
.
buildAfterCoarsen
(
adaptInfo
,
Flag
(
0
));
...
...
examples/stokes3.cc
View file @
ab268c22
...
...
@@ -55,7 +55,7 @@ int main(int argc, char** argv)
// set point constraint for pressure
prob
.
addDirichletBC
([](
auto
const
&
x
)
{
return
x
[
0
]
<
1.e-8
&&
x
[
1
]
<
1.e-8
;
},
_p
,
_p
,
0.0
);
AdaptInfo
adaptInfo
(
"adapt"
,
prob
.
getNumComponents
()
);
AdaptInfo
adaptInfo
(
"adapt"
);
// assemble and solve system
prob
.
buildAfterCoarsen
(
adaptInfo
,
Flag
(
0
));
...
...
src/amdis/ProblemInstat.hpp
View file @
ab268c22
...
...
@@ -58,15 +58,26 @@ namespace AMDiS
}
/// Returns \ref oldSolution.
decltype
(
auto
)
getOldSolution
()
{
return
*
oldSolution
;
}
decltype
(
auto
)
getOldSolution
()
const
{
return
*
oldSolution
;
}
std
::
unique_ptr
<
SystemVector
>
getOldSolutionVector
()
const
{
return
*
oldSolution
;
}
/// Return a mutable view to a oldSolution component
template
<
class
TreePath
=
RootTreePath
>
auto
getOldSolution
(
TreePath
const
&
path
=
{})
{
auto
&&
tp
=
makeTreePath
(
path
);
return
makeDOFVectorView
(
*
oldSolution
,
tp
);
}
/// Returns the I'th component of \ref oldSolution.
// template <std::size_t I = 0>
// decltype(auto) getOldSolution(const index_t<I> _i = {})
// {
// return (*oldSolution)[_i];
// }
/// Return a const view to a oldSolution component
template
<
class
TreePath
=
RootTreePath
>
auto
getOldSolution
(
TreePath
const
&
path
=
{})
const
{
auto
&&
tp
=
makeTreePath
(
path
);
return
makeDOFVectorView
(
*
oldSolution
,
tp
);
}
/// Implementation of \ref ProblemTimeInterface::transferInitialSolution().
virtual
void
transferInitialSolution
(
AdaptInfo
&
adaptInfo
)
override
;
...
...
@@ -80,7 +91,6 @@ namespace AMDiS
};
#if DUNE_HAVE_CXX_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
// Deduction rule
template
<
class
Traits
>
...
...
@@ -90,8 +100,7 @@ namespace AMDiS
// Generator for ProblemInstat with given ProblemStat
template
<
class
Traits
>
ProblemInstat
<
Traits
>
makeProblemInstat
(
std
::
string
name
,
ProblemStat
<
Traits
>&
prob
)
ProblemInstat
<
Traits
>
makeProblemInstat
(
std
::
string
name
,
ProblemStat
<
Traits
>&
prob
)
{
return
{
std
::
move
(
name
),
prob
};
}
...
...
src/amdis/ProblemInstat.inc.hpp
View file @
ab268c22
...
...
@@ -42,16 +42,10 @@ void ProblemInstat<Traits>::createUhOld()
{
AMDIS_FUNCNAME
(
"ProblemInstat::createUhOld()"
);
if
(
oldSolution
)
{
if
(
oldSolution
)
warning
(
"oldSolution already created
\n
"
);
}
else
{
const
int
size
=
problemStat
.
getNumComponents
();
// create oldSolution
std
::
vector
<
std
::
string
>
componentNames
(
size
,
name
+
"_uOld"
);
else
// create oldSolution
oldSolution
.
reset
(
new
SystemVector
(
*
problemStat
.
getGlobalBasis
(),
name
+
"_uOld"
));
}
}
...
...
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