Evolving surface finite element method
v0.3.0-14-g3598512
Numerical experiments for my papers
|
Implementation of the Elliott and Styles full discretization of the tumor problem. More...
#include <brusselator_algo.h>
Classes | |
struct | Fef |
Shortens Brusselator_scheme(). More... | |
struct | Init_data |
Initial data respectively exact solution for numerical experiments. More... | |
struct | Io |
Shortens Brusselator_scheme(). More... | |
Public Member Functions | |
Brusselator_scheme (int argc, char **argv, const std::string ¶meter_fname) | |
The constructor that also performs the first part before the loop enters. More... | |
void | eoc_logisticSphere () |
Experiment, where right-hand side is calculated for a known solution. More... | |
void | eoc_mcf () |
Dziuk mean curvature flow ESFEM. More... | |
void | sd () |
Sphere Dalquist. More... | |
void | eoc_sls () |
Surface logistic sphere. More... | |
void | eoc_sdp () |
EOC experiment for solution driven paper. More... | |
void | test () |
Run a simple test. | |
Prescribed ESFEM | |
void | standard_esfem () |
Standard Dziuk Elliott evolving surface finite element method. | |
Loop action | |
void | prePattern_loop () |
In some sense calculates the inital data for the solution driven problem. Starts from . | |
void | intermediate_action () |
To be used between prePattern_loop() and pattern_loop(). More... | |
void | pattern_loop () |
To be used in the second for-loop. If prePattern_loop() is off, then is here. More... | |
void | final_action () |
To be used after the second for-loop to save some data. | |
Private Member Functions | |
void | update_surface () |
Assign a new value to fef.surface.exact and fef.surface.app | |
void | update_scalar_solution () |
Assign a new value to fef.u.exact and fef.w.exact | |
template<class F > | |
void | print (Esfem::Io::Error_stream &os, const F &fem) |
Lifted printing. | |
template<class It1 , class It2 > | |
void | calculate_velocity (It1 xn_first, It1 xn_last, It1 xo_first, It2 v_first) |
Calculate the velocity via simple differential quotient. More... | |
void | error_on_intSurface () |
Plot error of fef on the interpolated surface. More... | |
void | pre_loop_action () |
Constructor helper. More... | |
void | rhs_and_solve_SPDE () |
Helper for pattern_loop(). More... | |
Flow control | |
void | next_timeStep () |
Increments the next time step in fix_grid . | |
long | prePattern_timeSteps () const |
Maximum number of time steps for prePattern_loop(). | |
long | pattern_timeSteps () const |
Maximum number of time steps for pattern_loop(). | |
long | time_steps () const |
Absolute number of time steps. | |
Private Attributes | |
Esfem::Io::Parameter | data |
Contains parameter from tumor_parameter.txt . | |
Io | io |
Error streams and identity functor for the surface. | |
Esfem::Grid::Grid_and_time | fix_grid |
Analytically given grid with absolute time provider. | |
Esfem::Io::L2H1_calculator | norm |
Norms on the analytically given grid. | |
Fef | fef |
Finite element functions. | |
Init_data | exact |
Exact solution for , and . | |
Friends | |
Helper classes for the for-loops | |
class | PreLoop_helper |
Used in pre_loop_action(). | |
class | PrePattern_helper |
Used in prePattern_loop(). | |
class | Pattern_helper |
Used in pattern_loop(). | |
class | RhsAndSolve_helper |
Used in rhs_and_solve_SPDE(). | |
Implementation of the Elliott and Styles full discretization of the tumor problem.
Find (growth-promoting), (growth-inhibiting) and such that
where for we use the Brusselator model
and and are some forcing terms, and for the surface
where is a forcing term.
Find (growth-promoting nodal values), (growth-inhibiting nodal values) and (surface nodal values) such that
We note that instead of the -projection we use the interpolation of , respectively .
We perform three steps.
where is elementwise normal.
where a tensor is, namely and means the constant finite element function.
Definition at line 147 of file brusselator_algo.h.
Brusselator_scheme::Brusselator_scheme | ( | int | argc, |
char ** | argv, | ||
const std::string & | parameter_fname | ||
) |
The constructor that also performs the first part before the loop enters.
argc | argc from main | |
[in] | argv | argv from main |
parameter_fname | Preferable absolute path to parameter file. |
Definition at line 71 of file brusselator_algo.cpp.
|
inlineprivate |
Calculate the velocity via simple differential quotient.
[in] | xn_first | Iterator to first point of the new surface |
[in] | xn_last | Iterator to last point of the new surface |
[in] | xo_first | Iterator to first point of the previous surface |
[out] | v_first | Iterator to the first value of the velocity |
xo_first
and v_first
point to as many elements as xn_first
does. Definition at line 438 of file brusselator_algo.h.
void Brusselator_scheme::eoc_logisticSphere | ( | ) |
Experiment, where right-hand side is calculated for a known solution.
As exact solution for the scalar valued surface equation I chose
For the surface evolution I chose
where is the logistic growth function, which satisfies the following ODE
From this it follows easily that the velocity is given by
Definition at line 116 of file brusselator_algo.cpp.
void Brusselator_scheme::eoc_mcf | ( | ) |
Dziuk mean curvature flow ESFEM.
(This is not any more true) Experiment reads as follows: Stationary surface with exact solution , with the formula
and
one easily sees
which implies that the right-hand side of the surface PDE vanishes.
Definition at line 169 of file brusselator_algo.cpp.
void Brusselator_scheme::eoc_sdp | ( | ) |
EOC experiment for solution driven paper.
As exact solution for the surface evolution I choose
satiesfies the ODE
which implies for the velocity
As exact solution for the scalar diffusion equation I choose
The coupled PDE equations reads as
where is given via
and the complicated is computed via Sage.
Definition at line 242 of file brusselator_algo.cpp.
void Brusselator_scheme::eoc_sls | ( | ) |
Surface logistic sphere.
As exact solution for the surface evolution I choose
satiesfies the ODE
which implies for the velocity
I do not consider coupling. For the surface PDE I choose
where must be
where we have used , where is the mean curvature (without aritmetic mean) and is the outwards pointing normal, and . It holds , where is the dimension of the sphere. Note that on the exact surface.
Definition at line 191 of file brusselator_algo.cpp.
|
private |
Plot error of fef
on the interpolated surface.
Definition at line 370 of file brusselator_algo.cpp.
void Brusselator_scheme::intermediate_action | ( | ) |
To be used between prePattern_loop() and pattern_loop().
The inital data has been created. It will be saved and the right hand side for the surface PDE will be created.
Definition at line 301 of file brusselator_algo.cpp.
void Brusselator_scheme::pattern_loop | ( | ) |
To be used in the second for-loop. If prePattern_loop() is off, then is here.
At this stage the tumor is growing.
Definition at line 314 of file brusselator_algo.cpp.
|
private |
Constructor helper.
Definition at line 393 of file brusselator_algo.cpp.
|
private |
Helper for pattern_loop().
Generates first part of the right-hand side for the scalar SPDE. Then solves the vector SPDE and prints out a dgf file.
Definition at line 406 of file brusselator_algo.cpp.
void Brusselator_scheme::sd | ( | ) |
Sphere Dalquist.
Initial surface is unit sphere in . Exact solution is
The PDE is
Definition at line 220 of file brusselator_algo.cpp.