Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
|
#include <ImmersedBoundarySimulationModifier.hpp>
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
void | UpdateFluidVelocityGrids (AbstractCellPopulation< DIM, DIM > &rCellPopulation) |
void | SetupConstantMemberVariables (AbstractCellPopulation< DIM, DIM > &rCellPopulation) |
void | ClearForcesAndSources () |
void | RecalculateAverageNodeSpacings () |
void | AddImmersedBoundaryForceContributions () |
void | PropagateForcesToFluidGrid () |
void | PropagateFluidSourcesToGrid () |
void | SolveNavierStokesSpectral () |
double | Delta1D (double dist, double spacing) |
void | Upwind2d (const multi_array< double, 3 > &rInput, multi_array< double, 3 > &rOutput) |
void | CalculateSourceGradients (const multi_array< double, 3 > &rRhs, multi_array< double, 3 > &rGradients) |
void | ZeroFieldSums (multi_array< double, 3 > &rField) |
Private Attributes | |
ImmersedBoundaryMesh< DIM, DIM > * | mpMesh |
ImmersedBoundaryCellPopulation< DIM > * | mpCellPopulation |
unsigned | mNodeNeighbourUpdateFrequency |
double | mGridSpacingX |
double | mGridSpacingY |
double | mFftNorm |
bool | mAdditiveNormalNoise |
double | mNoiseStrength |
unsigned | mNoiseSkip |
double | mNoiseLengthScale |
bool | mZeroFieldSums |
std::unique_ptr< ObsoleteBoxCollection< DIM > > | mpBoxCollection |
std::vector< std::pair< Node< DIM > *, Node< DIM > * > > | mNodePairs |
std::map< unsigned, std::set< unsigned > > | mNodeNeighbours |
double | mReynoldsNumber |
std::complex< double > | mI |
std::vector< boost::shared_ptr< AbstractImmersedBoundaryForce< DIM > > > | mForceCollection |
std::unique_ptr< ImmersedBoundary2dArrays< DIM > > | mpArrays |
std::unique_ptr< ImmersedBoundaryFftInterface< DIM > > | mpFftInterface |
std::unique_ptr< UniformGridRandomFieldGenerator< DIM > > | mpRandomField |
Friends | |
class | TestImmersedBoundarySimulationModifier |
class | boost::serialization::access |
A modifier class which at each simulation time step implements the immersed boundary algorithm similar to Rejniak et al (2004). A computational model of the mechanics of growth of the villous trophoblast bilayer. Bull. Math. Biol. 66:199–232. doi:10.1016/j.bulm.2003.06.001.
Definition at line 64 of file ImmersedBoundarySimulationModifier.hpp.
ImmersedBoundarySimulationModifier< DIM >::ImmersedBoundarySimulationModifier | ( | ) |
Default constructor.
Definition at line 45 of file ImmersedBoundarySimulationModifier.cpp.
|
virtualdefault |
Default destructor.
void ImmersedBoundarySimulationModifier< DIM >::AddImmersedBoundaryForce | ( | boost::shared_ptr< AbstractImmersedBoundaryForce< DIM > > | pForce | ) |
Add an immersed boundary force to be used in this modifier.
pForce | pointer to a force law |
Definition at line 797 of file ImmersedBoundarySimulationModifier.cpp.
|
private |
Loops over each immersed boundary force and invokes AddImmersedBoundaryForceContribution()
Definition at line 295 of file ImmersedBoundarySimulationModifier.cpp.
void ImmersedBoundarySimulationModifier< DIM >::AddNormalNoise | ( | ) | const |
Add the random noise as generated by mpRandomField
Definition at line 804 of file ImmersedBoundarySimulationModifier.cpp.
References SimulationTime::Instance().
|
private |
Calculates the vector of central differences of the fluid source grid
rRhs | const reference to rhs grids which contain the fluid source strengths |
rGradients | reference to grids storing the graidents |
Definition at line 755 of file ImmersedBoundarySimulationModifier.cpp.
|
private |
Helper method for UpdateFluidVelocityGrids() Ensures force applied to each node is reset to zero Ensures fluid force grids and source grid are reset
Definition at line 234 of file ImmersedBoundarySimulationModifier.cpp.
|
private |
Helper method for PropagateForcesToFluidGrid() Calculates the discrete delta approximation based on distance and grid spacing
dist | absolute 1-D distance between boundary-node and fluid-node |
spacing | the grid spacing |
Definition at line 696 of file ImmersedBoundarySimulationModifier.cpp.
bool ImmersedBoundarySimulationModifier< DIM >::GetAdditiveNormalNoise | ( | ) | const |
Definition at line 855 of file ImmersedBoundarySimulationModifier.cpp.
unsigned ImmersedBoundarySimulationModifier< DIM >::GetNodeNeighbourUpdateFrequency | ( | ) |
Definition at line 791 of file ImmersedBoundarySimulationModifier.cpp.
double ImmersedBoundarySimulationModifier< DIM >::GetNoiseLengthScale | ( | ) | const |
Definition at line 893 of file ImmersedBoundarySimulationModifier.cpp.
unsigned ImmersedBoundarySimulationModifier< DIM >::GetNoiseSkip | ( | ) | const |
Definition at line 881 of file ImmersedBoundarySimulationModifier.cpp.
double ImmersedBoundarySimulationModifier< DIM >::GetNoiseStrength | ( | ) | const |
Definition at line 868 of file ImmersedBoundarySimulationModifier.cpp.
double ImmersedBoundarySimulationModifier< DIM >::GetReynoldsNumber | ( | ) |
Definition at line 849 of file ImmersedBoundarySimulationModifier.cpp.
bool ImmersedBoundarySimulationModifier< DIM >::GetZeroFieldSums | ( | ) | const |
Definition at line 906 of file ImmersedBoundarySimulationModifier.cpp.
|
virtual |
Overridden OutputSimulationModifierParameters() method. Output any simulation modifier parameters to file.
rParamsFile | the file stream to which the parameters are output |
Implements AbstractCellBasedSimulationModifier< DIM, DIM >.
Definition at line 97 of file ImmersedBoundarySimulationModifier.cpp.
References AbstractCellBasedSimulationModifier< ELEMENT_DIM, SPACE_DIM >::OutputSimulationModifierParameters().
|
private |
Helper method for UpdateFluidVelocityGrids() Propagates fluid sources to grid
Definition at line 434 of file ImmersedBoundarySimulationModifier.cpp.
References NEVER_REACHED.
|
private |
Helper method for UpdateFluidVelocityGrids() Propagates elastic forces to fluid grid
Definition at line 307 of file ImmersedBoundarySimulationModifier.cpp.
References NEVER_REACHED, Node< SPACE_DIM >::rGetAppliedForce(), and Node< SPACE_DIM >::rGetLocation().
|
private |
Helper method for UpdateFluidVelocityGrids() Recalculate the average node spacings for elements and laminas. This is performed at each timestep so as to cache the values for safe reuse without re-calculation by force classes and other methods.
Definition at line 277 of file ImmersedBoundarySimulationModifier.cpp.
|
inlineprivate |
Boost Serialization method for archiving/checkpointing. Archives the object and its member variables.
archive | The boost archive. |
version | The current version of this class. |
Definition at line 81 of file ImmersedBoundarySimulationModifier.hpp.
void ImmersedBoundarySimulationModifier< DIM >::SetAdditiveNormalNoise | ( | bool | additiveNormalNoise | ) |
additiveNormalNoise | whether to include additive normal noise |
Definition at line 861 of file ImmersedBoundarySimulationModifier.cpp.
void ImmersedBoundarySimulationModifier< DIM >::SetNodeNeighbourUpdateFrequency | ( | unsigned | newFrequency | ) |
newFrequency | the new number of time steps after which node neighbours are re-calculated |
Definition at line 783 of file ImmersedBoundarySimulationModifier.cpp.
void ImmersedBoundarySimulationModifier< DIM >::SetNoiseLengthScale | ( | double | noiseLengthScale | ) |
noiseLengthScale | the new value of mNoiseLengthScale |
Definition at line 899 of file ImmersedBoundarySimulationModifier.cpp.
void ImmersedBoundarySimulationModifier< DIM >::SetNoiseSkip | ( | unsigned | noiseSkip | ) |
noiseSkip | the new value of mNoiseSkip |
Definition at line 887 of file ImmersedBoundarySimulationModifier.cpp.
void ImmersedBoundarySimulationModifier< DIM >::SetNoiseStrength | ( | double | noiseStrength | ) |
noiseStrength | the new value of mNoiseStrength |
Definition at line 874 of file ImmersedBoundarySimulationModifier.cpp.
void ImmersedBoundarySimulationModifier< DIM >::SetReynoldsNumber | ( | double | reynoldsNumber | ) |
reynoldsNumber | the new Reynolds number |
Definition at line 841 of file ImmersedBoundarySimulationModifier.cpp.
|
private |
Helper method for SetupSolve() Sets up all variables which need not change throughout the simulation
rCellPopulation | reference to the cell population |
Definition at line 129 of file ImmersedBoundarySimulationModifier.cpp.
References EXCEPTION, SimulationTime::GetTimeStep(), SimulationTime::Instance(), and NEVER_REACHED.
|
virtual |
Overridden SetupSolve() method.
Specify what to do in the simulation before the start of the time loop.
rCellPopulation | reference to the cell population |
outputDirectory | the output directory, relative to where Chaste output is stored |
Definition at line 82 of file ImmersedBoundarySimulationModifier.cpp.
void ImmersedBoundarySimulationModifier< DIM >::SetZeroFieldSums | ( | bool | zeroFieldSums | ) |
zeroFieldSums | the new value of mZeroFieldSums |
Definition at line 912 of file ImmersedBoundarySimulationModifier.cpp.
|
private |
Helper method for UpdateFluidVelocityGrids() Updates fluid velocity grids by solving Navier-Stokes
Definition at line 522 of file ImmersedBoundarySimulationModifier.cpp.
References SimulationTime::GetTimeStep(), and SimulationTime::Instance().
|
virtual |
Overridden UpdateAtEndOfTimeStep() method.
Specify what to do in the simulation at the end of each time step.
rCellPopulation | reference to the cell population |
Definition at line 68 of file ImmersedBoundarySimulationModifier.cpp.
References SimulationTime::Instance().
|
private |
Helper method to calculate elastic forces, propagate these to the fluid grid and solve Navier-Stokes to update the fluid velocity grids
rCellPopulation | reference to the cell population |
Definition at line 105 of file ImmersedBoundarySimulationModifier.cpp.
|
private |
Calculates upwind difference of fluid velocity grids
rInput | const reference to input grids |
rOutput | reference to output grids |
Definition at line 704 of file ImmersedBoundarySimulationModifier.cpp.
|
private |
Remove any bias in field sums.
rField | a reference to the field over which the field sums will be zeroed |
Definition at line 657 of file ImmersedBoundarySimulationModifier.cpp.
|
friend |
Needed for serialization.
Definition at line 72 of file ImmersedBoundarySimulationModifier.hpp.
|
friend |
To allow tests to directly access solver methods
Definition at line 69 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Whether to apply additive normal noise to the fluid force grids
Definition at line 105 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Normalising constant needed for FFT
Definition at line 102 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
A list of force laws to determine the force applied to each node
Definition at line 142 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Number of grid points in the x direction
Definition at line 96 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Number of grid points in the y direction
Definition at line 99 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Imaginary unit.
Definition at line 139 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
A map between node indices and a set of their possible neighbours, used calculating cell-cell interactions
Definition at line 129 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
How often we calculate which cells are neighbours
Definition at line 93 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
A vector of pairs of pointers to nodes, representing all possible node-node interactions
Definition at line 126 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
The length scale on which the Gaussian noise is correlated
Definition at line 117 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
A random field big enough to have a grid point for every fluid mesh point is likely too big to generate. mNoiseSkip is the sampling ratio such that ever mNoiseSkip^DIM sub-region takes the same noise value
Definition at line 114 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
The strength of the normal noise to be added to the force grids
Definition at line 108 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
An owning pointer to structure storing all necessary arrays
Definition at line 145 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
An owning pointer to a box collection for efficiently keeping track of node neighbours
Definition at line 123 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Non-owning pointer to the immersed boundary cell population
Definition at line 90 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
An owning pointer to the interface that handles discrete Fourier transforms
Definition at line 148 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Non-owning pointer to the immersed boundary mesh
Definition at line 87 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
An owning pointer to a uniform grid random field generator, for adding noise if required
Definition at line 151 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
The fluid Reynolds number.
Initialised to 1e-4 in the constructor.
Definition at line 136 of file ImmersedBoundarySimulationModifier.hpp.
|
private |
Whether to zero out the force and velocity fields to remove systematic drift
Definition at line 120 of file ImmersedBoundarySimulationModifier.hpp.