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 98 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 215 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 206 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 389 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 236 of heart/test/monodomain/TestMonodomainProblem.hpp
- Collect and print timings to benchmark different parts of the cardiac code. -- see line 124 of heart/test/bidomain/TestBidomain3D.hpp
- On large-scale parallel simulations it is advantageous to cache HDF5 output and only write to disk at end of simulation (or at checkpoint). This is achieved with SetUseHdf5DataWriterCache() -- see line 1646 of heart/test/monodomain/TestMonodomainProblem.hpp
- Only output data for particular nodes -- see line 578 of heart/test/bidomain/TestBidomainProblem.hpp
- Output all cell model state variables for the cell model used in a particular simulation -- see line 951 of heart/test/bidomain/TestBidomainProblem.hpp
- Output data using a light-weight output modifier. This can be used in addition to regular HDF5 output or can replace it. -- see line 588 of heart/test/bidomain/TestBidomainProblem.hpp
- Specify output formats (for different visualisers) -- see line 133 of heart/test/tutorials/TestAnotherBidomainSimulationTutorial.hpp
- Use the SingleTraceOutputModifier to output based on a global index (index AFTER any permutation has been applied) -- see line 1046 of heart/test/bidomain/TestBidomainProblem.hpp
Post-processing
- Compute action potential properties (APD50, APD90, max upstroke velocities, etc) given voltage traces. -- see line 56 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
- Do a monodomain simulation with equivalent conductivities to a bidomain simulation. -- see line 233 of heart/test/tutorials/TestEquivalentMonoAndBidomainTutorial.hpp
- Fix phi_e at particular nodes (note: this is not required) -- see line 264 of heart/test/bidomain/TestBidomainProblem.hpp
- Generate a slab (cuboid) mesh rather than read a mesh in, and pass it to solver -- see line 102 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 114 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 325 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 174 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 118 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 135 of crypt/test/simulation/TestGenerateSteadyStateCrypt.hpp
- Time various aspects of a cell-based simulation using CellBasedEventHandler. -- see line 434 of crypt/test/simulation/TestCryptSimulation2dNightly.hpp
Continuum mechanics
- Get or output stresses during a solve -- see line 634 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 944 of continuum_mechanics/test/TestCompressibleNonlinearElasticitySolver.hpp
Ventilation
- Solve a simple ventilation problem defined in a file. -- see line 390 of lung/test/ventilation/TestMatrixVentilationProblem.hpp
- Solve a simple ventilation problem defined in a file. -- see line 416 of lung/test/ventilation/TestVentilationProblem.hpp
- Solve a simple ventilation problem with no time variation. -- see line 272 of lung/test/ventilation/TestMatrixVentilationProblem.hpp
- Solve a simple ventilation problem with no time variation. -- see line 299 of lung/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 270 of global/test/TestCommandLineArguments.hpp
Archiving
- Use a binary rather than ascii boost archive format, for speed and smaller file sizes. -- see line 391 of global/test/TestArchiving.hpp
Lung
Anatomy definition
- Generate a complete conducting airway model given segmentations of CT airways and lobes. -- see line 47 of lung/test/tutorials/TestAirwayGenerationTutorial.hpp
Simulation
- Calculate transfer impedance of an airway tree using a simple impedance model -- see line 47 of lung/test/tutorials/TestSimpleImpedanceProblemTutorial.hpp
- Calculate ventilation distribution in an airway tree for a given flow rate at the trachea -- see line 47 of lung/test/tutorials/TestStaticVentilationTutorial.hpp
- Simulate ventilation on a full lung geometry with acinar dynamics over a breathing cycle. -- see line 47 of lung/test/tutorials/TestDynamicVentilationTutorial.hpp
Mesh
- Apply transformations to meshes -- see line 49 of mesh/test/TestTransformations.hpp
- Construct a distributed regular mesh (rectangle in 2D or cuboid in 3D) which does not have a default split plane. The default is for parallel code to split 2-D meshes into slices in the y-dimension and 3-D meshes in the z-dimension. -- see line 2283 of mesh/test/TestDistributedTetrahedralMesh.hpp
- Convert a linear tetrahedral mesh to quadratic and write back to file. -- see line 790 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 52 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.