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
MoReFEM
CoreLibrary
MoReFEM
Commits
ca4bd484
Commit
ca4bd484
authored
Jul 18, 2016
by
GILLES Sebastien
Browse files
#820
Start fine tuning what is and is not done in differentical call.
parent
22a3b67f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Sources/ModelInstances/UnderDevelopment/Poromechanics/ImplicitStepFluid/InnerLoop/VariationalFormulation.hxx
View file @
ca4bd484
...
...
@@ -68,37 +68,50 @@ namespace HappyHeart
corrected_values
.
UpdateGhosts
(
__FILE__
,
__LINE__
);
}
auto
&
system_matrix
=
parent
::
GetNonCstSystemMatrix
(
numbering_subset
,
numbering_subset
);
system_matrix
.
ZeroEntries
(
__FILE__
,
__LINE__
);
switch
(
is_differential
)
{
case
differential
::
no
:
{
auto
&
system_matrix
=
parent
::
GetNonCstSystemMatrix
(
numbering_subset
,
numbering_subset
);
system_matrix
.
ZeroEntries
(
__FILE__
,
__LINE__
);
ComputeMatrix
(
do_reuse_matrix
,
BlocksToRecompute
::
all
);
system_matrix
.
Assembly
(
__FILE__
,
__LINE__
);
system_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"full_matrix_"
+
GetIterationTag
()
+
".hhdata"
,
__FILE__
,
__LINE__
);
system_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"full_matrix_"
+
GetIterationTag
()
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
system_matrix
.
ViewBinary
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"full_matrix_"
+
GetIterationTag
()
+
".binary.hhdata"
,
__FILE__
,
__LINE__
);
break
;
}
case
differential
::
yes
:
// Just reuse tangent matrix computed at the end of last non differential case.
break
;
}
// switch
ComputeMatrix
(
do_reuse_matrix
,
BlocksToRecompute
::
all
);
ComputeRhs
(
is_differential
);
// must occur after T11, as it needs the t11 matrix.
system_matrix
.
Assembly
(
__FILE__
,
__LINE__
);
system_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"full_matrix_"
+
GetIterationTag
()
+
".hhdata"
,
__FILE__
,
__LINE__
);
system_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"full_matrix_"
+
GetIterationTag
()
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
system_matrix
.
ViewBinary
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"full_matrix_"
+
GetIterationTag
()
+
".binary.hhdata"
,
__FILE__
,
__LINE__
);
parent
::
template
SolveLinear
<
IsFactorized
::
no
>(
numbering_subset
,
numbering_subset
);
...
...
Sources/ModelInstances/UnderDevelopment/Poromechanics/ImplicitStepFluid/VariationalFormulation.hxx
View file @
ca4bd484
...
...
@@ -76,61 +76,64 @@ namespace HappyHeart
std
::
cout
<<
"Norm after inner loop = "
<<
current_norm
<<
std
::
endl
;
}
while
(
current_norm
>
1.e-12
&&
counter
<
10u
);
// \todo #820 Replace by proper stop condition from input file!
// Update fluidmass, velocity fluid and pressure.
Wrappers
::
Petsc
::
MatMult
(
inner_varf
.
GetMonolithic2Mass
().
GetInterpolationMatrix
(),
inner_varf
.
GetCorrectedValues
(),
variable_holder_parent
::
GetNonCstVariableHolder
().
GetNonCstFluidMassVector
(),
__FILE__
,
__LINE__
);
// Perform one mo
re
ti
me to update T21, T33 and T33 without Dirichlet.
if
(
is_diffe
re
n
ti
al
==
differential
::
no
)
{
decltype
(
auto
)
updated_matrix
=
inner_varf
.
ComputeMatrixWithUpdatedT21
();
// Update fluidmass, velocity fluid and pressure.
Wrappers
::
Petsc
::
MatMult
(
inner_varf
.
GetMonolithic2Mass
().
GetInterpolationMatrix
(),
inner_varf
.
GetCorrectedValues
(),
variable_holder_parent
::
GetNonCstVariableHolder
().
GetNonCstFluidMassVector
(),
__FILE__
,
__LINE__
);
// \todo #820 - #530 Use Swap when available!
GetNonCstMonolithicMatrixAfterInnerLoop
().
Copy
(
updated_matrix
,
__FILE__
,
__LINE__
);
// Perform one more time to update T21, T33 and T33 without Dirichlet.
{
decltype
(
auto
)
updated_matrix
=
inner_varf
.
ComputeMatrixWithUpdatedT21
();
// \todo #820 - #530 Use Swap when available!
GetNonCstMonolithicMatrixAfterInnerLoop
().
Copy
(
updated_matrix
,
__FILE__
,
__LINE__
);
updated_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"matrix_after_FP_mixt_with_dirichlet_time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
}
updated_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"matrix_after_FP_mixt_with_dirichlet_time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
}
{
// \todo #820 - #530 Use Swap when available!
decltype
(
auto
)
updated_matrix
=
inner_varf
.
ComputeMatrixWithUpdatedT33WithoutDirichlet
();
GetNonCstMonolithicMatrixAfterInnerLoopWithoutDirichlet
().
Copy
(
updated_matrix
,
__FILE__
,
__LINE__
);
// \todo #820 Not exactly equal to Freefem; investigate if one term is missing!
updated_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"matrix_after_FP_mixt_without_dirichlet_time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
}
{
decltype
(
auto
)
darcy_vector
=
GetNonCstDarcyVector
();
{
// \todo #820 - #530 Use Swap when available!
decltype
(
auto
)
updated_matrix
=
inner_varf
.
ComputeMatrixWithUpdatedT33WithoutDirichlet
();
GetNonCstMonolithicMatrixAfterInnerLoopWithoutDirichlet
().
Copy
(
updated_matrix
,
__FILE__
,
__LINE__
);
// \todo #820 Not exactly equal to Freefem; investigate if one term is missing!
updated_matrix
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"matrix_after_FP_mixt_without_dirichlet_time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
}
inner_varf
.
ComputeDarcy
(
-
1.
,
IsFullDarcy
::
no
,
darcy_vector
);
darcy_vector
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"darcy_vector_after_FP_mixt_time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
{
decltype
(
auto
)
darcy_vector
=
GetNonCstDarcyVector
();
inner_varf
.
ComputeDarcy
(
-
1.
,
IsFullDarcy
::
no
,
darcy_vector
);
darcy_vector
.
View
(
parent
::
MpiHappyHeart
(),
parent
::
GetOutputDirectory
(
numbering_subset
)
+
"/"
+
DifferentialPreffix
(
is_differential
)
+
"darcy_vector_after_FP_mixt_time_"
+
std
::
to_string
(
parent
::
GetTimeManager
().
NtimeModified
())
+
".m"
,
__FILE__
,
__LINE__
,
PETSC_VIEWER_ASCII_MATLAB
);
}
}
}
...
...
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