Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CardMech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIT
Mpp
CardMech
Commits
c37c0533
Commit
c37c0533
authored
2 years ago
by
jonathan.froehlich
Browse files
Options
Downloads
Patches
Plain Diff
Updated comments
parent
7e1fb38d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!231
Resolve "Document Code"
Pipeline
#125730
canceled
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/coupled/solvers/SegregatedSolver.cpp
+9
-3
9 additions, 3 deletions
src/coupled/solvers/SegregatedSolver.cpp
src/coupled/solvers/SegregatedSolver.hpp
+13
-6
13 additions, 6 deletions
src/coupled/solvers/SegregatedSolver.hpp
with
22 additions
and
9 deletions
src/coupled/solvers/SegregatedSolver.cpp
+
9
−
3
View file @
c37c0533
...
...
@@ -172,8 +172,10 @@ void SegregatedSolver::Step(IElphyAssemble &elphyAssemble, IElasticity &mechAsse
*/
vout
(
2
)
<<
"Solving MechStep from "
<<
mechAssemble
.
Time
()
<<
" to "
<<
mechAssemble
.
NextTimeStep
(
false
)
<<
endl
;
elphyAssemble
.
ResetTime
(
mechAssemble
.
Time
(),
mechAssemble
.
NextTimeStep
(
false
),
elphySteps
);
elphyAssemble
.
UpdateDeformation
(
u_displacement
(
mechValues
),
v_potential
(
elphyValues
));
while
(
!
elphyAssemble
.
IsFinished
())
{
vout
(
3
)
<<
"Solving ElphyProblem in ["
<<
elphyAssemble
.
FirstTStep
()
<<
", "
<<
elphyAssemble
.
LastTStep
()
...
...
@@ -182,19 +184,23 @@ void SegregatedSolver::Step(IElphyAssemble &elphyAssemble, IElasticity &mechAsse
elphySolver
->
SolveStep
(
elphyAssemble
,
elphyValues
);
}
// Projects stretch from elphy to mech
cardiacTransfer
->
Project
(
u_stretch
(
mechValues
),
v_stretch
(
elphyValues
));
mechAssemble
.
UpdateStretch
(
u_stretch
(
mechValues
));
// Solves one mech step
mechSolver
->
Step
(
mechAssemble
,
u_displacement
(
mechValues
));
// Interpolates iota_4 from mech to elphy
mechAssemble
.
GetInvariant
(
u_displacement
(
mechValues
),
u_iota
(
mechValues
));
cardiacTransfer
->
Prolongate
(
u_iota
(
mechValues
),
v_iota
(
elphyValues
));
cardiacTransfer
->
Project
(
u_pot
(
mechValues
),
v_potential
(
elphyValues
));
}
void
SegregatedSolver
::
PlotIteration
(
const
IElphyAssemble
&
elphyAssemble
,
const
IElasticity
&
mechAssemble
,
const
Vectors
&
elphyValues
,
const
Vectors
&
mechValues
)
{
const
IElasticity
&
mechAssemble
,
Vectors
&
elphyValues
,
Vectors
&
mechValues
)
const
{
cardiacTransfer
->
Project
(
u_pot
(
mechValues
),
v_potential
(
elphyValues
));
if
(
vtk
<=
0
)
return
;
if
(
elphyVtk
>
0
)
elphyAssemble
.
PlotIteration
(
elphyValues
,
mechAssemble
.
Step
());
...
...
This diff is collapsed.
Click to expand it.
src/coupled/solvers/SegregatedSolver.hpp
+
13
−
6
View file @
c37c0533
...
...
@@ -12,6 +12,15 @@
#include
"solvers/ElphySolver.hpp"
#include
"solvers/DynamicMechanicsSolver.hpp"
/**
* Solves coupled electro-elastodynamical problem with the following scheme:
* 0. Initialize ELPHY and MECH
* 1. Solve ELPHY from t_n to t_{n+1} in m steps
* 2. Project values from ELPHY to MECH
* 3. Solve MECH from t_n to t_{n+1} in 1 step
* 4. Interpolate values from MECH to ELPHY
* 5. If t_{n+1} = t_N STOP, else return to 1.
*/
class
SegregatedSolver
:
public
CardiacSolver
{
int
elphyVtk
{
0
};
int
mechVtk
{
0
};
...
...
@@ -24,14 +33,12 @@ class SegregatedSolver : public CardiacSolver {
std
::
unique_ptr
<
ElastodynamicTimeIntegrator
>
mechSolver
;
void
printStep
();
void
printFullEvaluation
();
void
initEvaluation
(
const
IElphyAssemble
&
elphyAssemble
,
const
IElasticity
&
elasticityAssemble
);
public
:
/*explicit SegregatedSolver() : SegregatedSolver(GetElphySolver(), GetDynamicSolver()) {}
explicit SegregatedSolver(const string &elphySolverName, const string& mechSolverName)
: SegregatedSolver(GetElphySolver(elphySolverName), GetDynamicSolver(mechSolverName)) {}*/
explicit
SegregatedSolver
(
std
::
unique_ptr
<
ElphySolver
>
&&
eSolver
,
std
::
unique_ptr
<
ElastodynamicTimeIntegrator
>
&&
mSolver
,
...
...
@@ -55,9 +62,9 @@ public:
void
EvaluateIteration
(
const
IElphyAssemble
&
elphyAssemble
,
const
IElasticity
&
mechAssemble
,
Vectors
elphyValues
,
Vectors
mechValues
);
void
PlotIteration
(
const
IElphyAssemble
&
elphyAssemble
,
const
IElasticity
&
mechAssemble
,
const
Vectors
&
elphyValues
,
const
Vectors
&
mechValues
);
void
PlotIteration
(
const
IElphyAssemble
&
elphyAssemble
,
const
IElasticity
&
mechAssemble
,
Vectors
&
elphyValues
,
Vectors
&
mechValues
)
const
;
void
Initialize
(
IElphyAssemble
&
elphyAssemble
,
IElasticity
&
mechAssemble
,
Vector
&
potential
,
Vector
&
displacement
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment