Chaste HOWTO Index
As well as ensuring that Chaste functions as expected, the many Chaste tests can be effective for learning how to use Chaste. There are often aspects of Chaste's capabilities that do not warrant a full user tutorial, but are still worth noting. Equally, users often ask "how do I do...", and in many cases there is already a test that does something similar and can be used as a basis.
This page contains a (probably partial) index of links to useful code. Some of the links are to code in tutorials. The others are links to test code. For the latter, note that since tests are written primarily for checking functionality, they are not commented to the same degree as user tutorials. Never-the-less they should be reasonably readable and useful.
Note that this page is generated automatically based on tags in the Chaste code. Do not edit it manually, as your changes will be overwritten!
Cardiac
Cell Models
- Get a cardiac cell model to (roughly) a steady state, given a regular stimulus, using the SteadyStateRunner class. -- see line 100 of heart/test/ionicmodels/TestSteadyStateRunner.hpp
Electro-mechanics
- Run basic electro-mechanics simulations; specify different models, boundary conditions, fibres -- see line 117 of heart/test/tutorials/TestCardiacElectroMechanicsTutorial.hpp
- Run electro-mechanical simulations using bidomain instead of monodomain -- see line 217 of heart/test/mechanics/TestCardiacElectroMechanicsProblem.hpp
- Run electro-mechanics with inflation pressures -- see line 273 of heart/test/tutorials/TestAnotherCardiacElectroMechanicsTutorial.hpp
- Run electro-mechanics with mechano-electric feedback -- see line 100 of heart/test/tutorials/TestAnotherCardiacElectroMechanicsTutorial.hpp
- Set heterogeneous contraction models by using a contraction cell factory. -- see line 148 of heart/test/TestAbstractContractionCellFactory.hpp
- Visualise results in Cmgui (very brief description) -- see line 205 of heart/test/tutorials/TestCardiacElectroMechanicsTutorial.hpp
Output
- Calculating and outputting ionic currents ('derived quantities') in a single cell simulation using class:OdeSolution - see also this page. -- see line 362 of heart/test/ionicmodels/TestCvodeCells.hpp
- Calculating and outputting ionic currents ('derived quantities') in a tissue simulation using class:HeartConfig - see also this page. -- see line 248 of heart/test/monodomain/TestMonodomainProblem.hpp
- Only output data for particular nodes -- see line 568 of heart/test/bidomain/TestBidomainProblem.hpp
- Output all cell model state variables for the cell model used in a particular simulation -- see line 927 of heart/test/bidomain/TestBidomainProblem.hpp
- Specify output formats (for different visualisers) -- see line 133 of heart/test/tutorials/TestAnotherBidomainSimulationTutorial.hpp
Post-processing
- Compute action potential properties (APD50, APD90, max upstroke velocities, etc) given voltage traces. -- see line 57 of heart/test/postprocessing/TestCellProperties.hpp
- Compute pseudo-ECGs -- see line 59 of heart/test/postprocessing/TestPseudoEcgCalculator.hpp
- Convert already generated simulation (HDF5) results to Cmgui format. -- see line 61 of heart/test/postprocessing/TestHdf5ToVisualizerConverters.hpp
- Convert already generated simulation (HDF5) results to text, VTK or Meshalyzer format. -- see line 64 of pde/test/utilities/TestHdf5Converters.hpp
Problem definition
- Fix phi_e at particular nodes (note: this is not required) -- see line 254 of heart/test/bidomain/TestBidomainProblem.hpp
- Generate a slab (cuboid) mesh rather than read a mesh in, and pass it to solver -- see line 101 of heart/test/tutorials/TestMonodomain3dExampleTutorial.hpp
- Generate fibre field definitions for cardiac geometries using a mathematical rule approach -- see line 48 of heart/test/fibres/TestStreeterFibreGenerator.hpp
- Read in a mesh from file, via HeartConfig. -- see line 99 of heart/test/tutorials/TestMonodomain3dRabbitHeartTutorial.hpp
- Run bidomain simulations with a perfusing bath, and apply shocks using electrodes -- see line 47 of heart/test/tutorials/TestBidomainWithBathTutorial.hpp
- Save ('checkpoint') and reload simulations -- see line 49 of heart/test/tutorials/TestCardiacCheckpointingAndRestartingTutorial.hpp
- Set discrete cuboid areas to have heterogeneous (intra- and/or extra-cellular) conductivity tensors. -- see line 82 of heart/test/TestHeterogeneousConductivities.hpp
- Set discrete ellipsoid areas to have heterogeneous (intra- and/or extra-cellular) conductivity tensors. -- see line 260 of heart/test/bidomain/TestBidomainTissue.hpp
- Set up and run basic bidomain simulations -- see line 48 of heart/test/tutorials/TestRunningBidomainSimulationsTutorial.hpp
- Specify fibre directions -- see line 87 of heart/test/tutorials/TestAnotherBidomainSimulationTutorial.hpp
- Tell Chaste that a mesh has been modified -- see line 179 of heart/test/tutorials/TestBidomainWithBathTutorial.hpp
- Use a CVODE adaptor solver in a tissue simulation -- see line 121 of heart/test/performance/Test1dMonodomainShannonCvodeBenchmarks.hpp
- Use a genuinely Neumann intracellular stimulus, rather than default volume stimulus -- see line 54 of heart/test/stimuli/TestNeumannStimulus.hpp
- Use a native CVODE cell in a tissue simulation -- see line 168 of heart/test/performance/Test1dMonodomainShannonCvodeBenchmarks.hpp
- Use different cell models, defined using cellml files -- see line 74 of heart/test/tutorials/TestRunningBidomainSimulationsTutorial.hpp
Solver
- Run using (simple, user-defined) time-adaptivity -- see line 51 of heart/test/monodomain/TestMonodomainWithTimeAdaptivity.hpp
- Run using operator-splitting -- see line 58 of heart/test/monodomain/TestOperatorSplittingMonodomainSolver.hpp
- Use state-variable interpolation to improve accuracy -- see line 89 of heart/test/bidomain/TestBidomainWithSvi.hpp
- Using specialised Backward Euler implementation to solve the cell models (allows for much larger timesteps) -- see line 64 of heart/test/tutorials/TestBidomainWithBathTutorial.hpp
Cell Based
Simulation
- Save and load ('checkpoint') a cell-based simulation to file. -- see line 132 of crypt/test/simulation/TestGenerateSteadyStateCrypt.hpp
- Time various aspects of a cell-based simulation using CellBasedEventHandler. -- see line 447 of crypt/test/simulation/TestCryptSimulation2dNightly.hpp
Continuum mechanics
- Get or output stresses during a solve -- see line 630 of continuum_mechanics/test/TestIncompressibleNonlinearElasticitySolver.hpp
- Solve Stokes' flow problems (this functionality is work-in-progress). -- see line 51 of continuum_mechanics/test/TestStokesFlowSolver.hpp
- Solve nonlinear elasticity problems -- see line 107 of continuum_mechanics/test/TestSolvingElasticityProblemsTutorial.hpp
- Specify more complicated boundary conditions in elasticity problems -- see line 77 of continuum_mechanics/test/TestSolvingMoreElasticityProblemsTutorial.hpp
- Visualise nonlinear elasticity problems solutions, including visualisng strains -- see line 222 of continuum_mechanics/test/TestSolvingElasticityProblemsTutorial.hpp
- Write strain after solve -- see line 946 of continuum_mechanics/test/TestCompressibleNonlinearElasticitySolver.hpp
Ventilation
- Solve a simple ventilation problem defined in a file. -- see line 422 of continuum_mechanics/test/ventilation/TestVentilationProblem.hpp
- Solve a simple ventilation problem with no time variation. -- see line 317 of continuum_mechanics/test/ventilation/TestVentilationProblem.hpp
General
- Read and use parameters from the command line -- see line 46 of global/test/TestCommandLineArguments.hpp
- Use mock/pretend command line arguments -- see line 256 of global/test/TestCommandLineArguments.hpp
Mesh
- Apply transformations to meshes -- see line 49 of mesh/test/TestTransformations.hpp
- Convert a linear tetrahedral mesh to quadratic and write back to file. -- see line 783 of mesh/test/TestQuadraticMesh.hpp
- Write meshes to file -- see line 58 of mesh/test/writer/TestMeshWriters.hpp
PDE
- Define and solve a particular type of coupled ODE/PDE system -- see line 47 of pde/test/tutorials/TestSolvingLinearParabolicPdeSystemsWithCoupledOdeSystemsTutorial.hpp
- Define and solve linear elliptic or parabolic PDEs -- see line 47 of pde/test/tutorials/TestSolvingLinearPdesTutorial.hpp
- Define and solve nonlinear elliptic PDEs -- see line 52 of pde/test/tutorials/TestSolvingNonlinearPdesTutorial.hpp
- Evaluate integrals (using a solution from a PDE solve say) over a finite element mesh -- see line 49 of pde/test/utilities/TestAbstractFunctionalCalculator.hpp
- Output results to file for time-dependent PDE solvers -- see line 341 of pde/test/tutorials/TestSolvingLinearPdesTutorial.hpp
- Write a solver for coupled nonlinear PDEs (advanced) -- see line 53 of pde/test/TestSolvingCoupledNonlinearPdes.hpp
- Write new PDE solvers (especially for linear coupled elliptic/parabolic systems) -- see line 54 of pde/test/tutorials/TestWritingPdeSolversTutorial.hpp
Creating new HOWTOs
Any C-style block comment found in a test file that looks like the following will be given an entry in the index.
* HOW_TO_TAG Section/Subsection * Short description (ideally one-liner)
The short description may run over multiple lines; it will be considered to end either at the end of the comment, or at a blank comment line, whichever comes first.