Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MoReFEM
CoreLibrary
MoReFEM
Commits
d4ddf27e
Commit
d4ddf27e
authored
Jul 22, 2016
by
GILLES Sebastien
Browse files
#820
Cleaning-up about numbering of iterations.
parent
afc91187
Changes
7
Hide whitespace changes
Inline
Side-by-side
Sources/ModelInstances/UnderDevelopment/Poromechanics/ImplicitStepFluid/InnerLoop/VariationalFormulation.hpp
View file @
d4ddf27e
...
...
@@ -184,8 +184,7 @@ namespace HappyHeart
*
* \todo #9 - #820 To complete!
*/
double
PerformDifferential
(
unsigned
int
iteration
,
const
GlobalMatrix
&
monolithic_with_dirichlet
,
double
PerformDifferential
(
const
GlobalMatrix
&
monolithic_with_dirichlet
,
const
GlobalMatrix
&
monolithic_without_dirichlet
);
...
...
@@ -482,8 +481,7 @@ namespace HappyHeart
//! Non constant accessor to the t21 on the non monolithic FEltSpace.
GlobalMatrix
&
GetNonCstT21OnFluidMesh
()
noexcept
;
//! Index of the current inner loop (for outputs).
template
<
differential
is_differential
>
//! Index of the current inner loop (for outputs).
unsigned
int
GetIndexInnerLoop
()
const
noexcept
;
//! Constant accessor to the parameter that encapsulates velocity part of the current solution.
...
...
@@ -606,7 +604,6 @@ namespace HappyHeart
*
* \warning Only Perform() should call this one!
*/
template
<
differential
is_differential
>
void
SetIndexInnerLoop
(
unsigned
int
index
)
noexcept
;
//! Returns the string that gives current time and current inner loop index.
...
...
@@ -1020,8 +1017,8 @@ namespace HappyHeart
//! Internal friction (Dporo in Freefem script).
double
internal_friction_
=
std
::
numeric_limits
<
double
>::
lowest
();
//! Index of the current inner loop (for outputs).
First is for non differential case, second for differential
.
std
::
array
<
unsigned
int
,
2u
>
index_inner_loop_
{{
NumericNS
::
UninitializedIndex
<
unsigned
int
>
(),
NumericNS
::
UninitializedIndex
<
unsigned
int
>
()
}}
;
//! Index of the current inner loop (for outputs).
Differential indexes do not use this one directly
.
unsigned
int
index_inner_loop_
=
NumericNS
::
UninitializedIndex
<
unsigned
int
>
();
//! Parameter that encapsulates velocity part of the current solution.
ParameterAtDof
<
ParameterNS
::
Type
::
vector
>::
type
::
const_unique_ptr
velocity_solution_param_
=
nullptr
;
...
...
Sources/ModelInstances/UnderDevelopment/Poromechanics/ImplicitStepFluid/InnerLoop/VariationalFormulation.hxx
View file @
d4ddf27e
...
...
@@ -32,7 +32,7 @@ namespace HappyHeart
double
VariationalFormulation
<
HyperelasticLawT
>
::
Perform
(
unsigned
int
iteration
)
{
SetIndexInnerLoop
<
differential
::
no
>
(
iteration
);
SetIndexInnerLoop
(
iteration
);
decltype
(
auto
)
time_manager
=
parent
::
GetTimeManager
();
decltype
(
auto
)
god_of_dof
=
parent
::
GetGodOfDof
();
decltype
(
auto
)
numbering_subset
=
...
...
@@ -144,11 +144,9 @@ namespace HappyHeart
template
<
class
HyperelasticLawT
>
double
VariationalFormulation
<
HyperelasticLawT
>
::
PerformDifferential
(
unsigned
int
iteration
,
const
GlobalMatrix
&
monolithic_with_dirichlet
,
::
PerformDifferential
(
const
GlobalMatrix
&
monolithic_with_dirichlet
,
const
GlobalMatrix
&
monolithic_without_dirichlet
)
{
SetIndexInnerLoop
<
differential
::
yes
>
(
iteration
);
//decltype(auto) time_manager = parent::GetTimeManager();
decltype
(
auto
)
god_of_dof
=
parent
::
GetGodOfDof
();
decltype
(
auto
)
numbering_subset
=
...
...
@@ -585,10 +583,9 @@ namespace HappyHeart
template
<
class
HyperelasticLawT
>
template
<
differential
is_differential
>
void
VariationalFormulation
<
HyperelasticLawT
>::
SetIndexInnerLoop
(
unsigned
int
index
)
noexcept
{
index_inner_loop_
[
EnumUnderlyingType
(
is_differential
)]
=
index
;
index_inner_loop_
=
index
;
}
...
...
@@ -596,10 +593,20 @@ namespace HappyHeart
template
<
differential
is_differential
>
std
::
string
VariationalFormulation
<
HyperelasticLawT
>::
GetIterationTag
()
const
noexcept
{
return
"time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
"_"
std
::
string
ret
=
"time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
"_"
+
DifferentialPreffix
(
is_differential
)
+
"it_"
+
std
::
to_string
(
GetIndexInnerLoop
<
is_differential
>
());
+
"it_"
;
switch
(
is_differential
)
{
case
differential
::
no
:
ret
+=
std
::
to_string
(
GetIndexInnerLoop
());
break
;
case
differential
::
yes
:
ret
+=
std
::
to_string
(
variable_holder_parent
::
GetVariableHolder
().
gmres_iteration_index
);
}
return
ret
;
}
...
...
Sources/ModelInstances/UnderDevelopment/Poromechanics/ImplicitStepFluid/InnerLoop/VariationalFormulationAccessors.hxx
View file @
d4ddf27e
...
...
@@ -480,10 +480,9 @@ namespace HappyHeart
template
<
class
HyperelasticLawT
>
template
<
differential
is_differential
>
unsigned
int
VariationalFormulation
<
HyperelasticLawT
>::
GetIndexInnerLoop
()
const
noexcept
{
return
index_inner_loop_
[
EnumUnderlyingType
(
is_differential
)]
;
return
index_inner_loop_
;
}
...
...
@@ -496,7 +495,6 @@ namespace HappyHeart
}
template
<
class
HyperelasticLawT
>
inline
const
ParameterAtDof
<
ParameterNS
::
Type
::
vector
>::
type
&
VariationalFormulation
<
HyperelasticLawT
>
::
GetDeltaVelocitySolutionParam
()
const
noexcept
...
...
Sources/ModelInstances/UnderDevelopment/Poromechanics/ImplicitStepFluid/VariationalFormulation.hxx
View file @
d4ddf27e
...
...
@@ -137,10 +137,7 @@ namespace HappyHeart
auto
&
inner_varf
=
GetNonCstInnerLoopVarf
();
auto
counter
=
0u
;
current_norm
=
inner_varf
.
PerformDifferential
(
counter
++
,
GetMonolithicMatrixAfterInnerLoop
(),
current_norm
=
inner_varf
.
PerformDifferential
(
GetMonolithicMatrixAfterInnerLoop
(),
GetMonolithicMatrixAfterInnerLoopWithoutDirichlet
());
std
::
cout
<<
"Norm after inner loop = "
<<
current_norm
<<
std
::
endl
;
}
...
...
Sources/ModelInstances/UnderDevelopment/Poromechanics/Model.hpp
View file @
d4ddf27e
...
...
@@ -487,11 +487,6 @@ namespace HappyHeart
std
::
array
<
GlobalVector
::
unique_ptr
,
EnumUnderlyingType
(
SolidIndex
::
Nvector
)
>
solid_vector_list_
=
Utilities
::
NullptrArray
<
GlobalVector
::
unique_ptr
,
EnumUnderlyingType
(
SolidIndex
::
Nvector
)
>
();
//! Index of gmres iteration. \todo #820 For dev purpose!
unsigned
int
gmres_iteration_index_
=
0u
;
};
...
...
Sources/ModelInstances/UnderDevelopment/Poromechanics/Model.hxx
View file @
d4ddf27e
...
...
@@ -92,7 +92,7 @@ namespace HappyHeart
delta_displacement
.
ZeroEntries
(
__FILE__
,
__LINE__
);
gmres_iteration_index
_
=
static_cast
<
unsigned
int
>
(
-
1
);
GetNonCstVariableHolder
().
gmres_iteration_index
=
static_cast
<
unsigned
int
>
(
-
1
);
dH_solver_
->
SolveLinear
(
gmres_shell_matrix
,
gmres_shell_matrix
,
GetVector
<
SolidIndex
::
H0
>
(),
delta_displacement
,
...
...
@@ -242,7 +242,7 @@ namespace HappyHeart
void
Model
<
SolidVariationalFormulationPolicyT
>
::
ShellMatrixOperation
(
Vec
petsc_input_vector
,
Vec
&
petsc_output_vector
)
{
++
gmres_iteration_index
_
;
++
GetNonCstVariableHolder
().
gmres_iteration_index
;
auto
&
implicit_step_varf
=
GetNonCstImplicitStepFluidVarf
();
...
...
Sources/ModelInstances/UnderDevelopment/Poromechanics/VariableHolder.hpp
View file @
d4ddf27e
...
...
@@ -124,6 +124,10 @@ namespace HappyHeart
//! Constant accessor to the material parameters related to the solid.
const
Solid
&
GetSolid
()
const
noexcept
;
//! Index of gmres iteration. \todo #820 For dev purpose!
unsigned
int
gmres_iteration_index
=
0u
;
private:
...
...
@@ -151,8 +155,7 @@ namespace HappyHeart
//! Midpoint position. // \todo #820 TMP: midpoint time scheme should not be the sole choice!
const
GlobalVector
*
midpoint_position_
=
nullptr
;
};
...
...
Write
Preview
Markdown
is supported
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