HeartConfigDefaults.hpp

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 #ifndef HEARTCONFIGDEFAULTS_HPP_
00030 #define HEARTCONFIGDEFAULTS_HPP_
00031 
00081 boost::shared_ptr<cp::chaste_parameters_type> CreateDefaultParameters()
00082 {
00083     // Simulation parameters
00084     cp::simulation_type simulation_params;
00085     simulation_params.SpaceDimension().set(3);
00086     cp::domain_type domain("Mono");
00087     simulation_params.Domain().set(domain);
00088     cp::ionic_model_selection_type default_ionic_model;
00089     cp::ionic_models_available_type ionic_model("LuoRudyI");
00090     default_ionic_model.Hardcoded().set(ionic_model);
00091     cp::ionic_models_type ionic_models(default_ionic_model);
00092     simulation_params.IonicModels().set(ionic_models);
00093     simulation_params.OutputDirectory().set("ChasteResults");
00094     simulation_params.OutputFilenamePrefix().set("SimulationResults");
00095     
00096     // Physiological parameters
00097     cp::physiological_type phys_params;
00098     XSD_CREATE_WITH_FIXED_ATTR3(cp::conductivities_type, intra_conductivities,
00099                                 1.75, 1.75, 1.75, "mS/cm");
00100     phys_params.IntracellularConductivities().set(intra_conductivities);
00101     XSD_CREATE_WITH_FIXED_ATTR3(cp::conductivities_type, extra_conductivities,
00102                                 7.0, 7.0, 7.0, "mS/cm");
00103     phys_params.ExtracellularConductivities().set(extra_conductivities);
00104     XSD_CREATE_WITH_FIXED_ATTR1(cp::conductivity_type, bath_conductivity, 7.0, "mS/cm");
00105     phys_params.BathConductivity().set(bath_conductivity);
00106     XSD_CREATE_WITH_FIXED_ATTR1(cp::inverse_length_type, surface_area_to_volume_ratio, 1400, "1/cm");
00107     phys_params.SurfaceAreaToVolumeRatio().set(surface_area_to_volume_ratio);
00108     XSD_CREATE_WITH_FIXED_ATTR1(cp::capacitance_type, capacitance, 1.0, "uF/cm^2");
00109     phys_params.Capacitance().set(capacitance);
00110     
00111     // Numerical parameters
00112     cp::numerical_type numerical_params;
00113     XSD_CREATE_WITH_FIXED_ATTR3(cp::time_steps_type, timesteps, 0.01, 0.01, 0.01, "ms");
00114     cp::ksp_tolerances_type tolerances;
00115     tolerances.KSPAbsolute().set(2e-4);
00116     cp::ksp_solver_type ksp_solver("cg");
00117     cp::ksp_preconditioner_type ksp_precond("bjacobi");
00118     cp::mesh_partitioning_type mesh_partitioning("metis");
00119     numerical_params.TimeSteps().set(timesteps);
00120     numerical_params.KSPTolerances().set(tolerances);
00121     numerical_params.KSPSolver().set(ksp_solver);
00122     numerical_params.KSPPreconditioner().set(ksp_precond);
00123     numerical_params.MeshPartitioning().set(mesh_partitioning);
00124     numerical_params.UseStateVariableInterpolation().set(cp::yesno_type::no);
00125     
00126     // Postprocessing
00127     cp::postprocessing_type postproc;
00128     
00129     // Full default parameters
00130     boost::shared_ptr<cp::chaste_parameters_type> p_defaults(new cp::chaste_parameters_type(phys_params, numerical_params));
00131     p_defaults->Simulation().set(simulation_params);
00132     p_defaults->PostProcessing().set(postproc);
00133     return p_defaults;
00134 }
00135 
00136 #endif /*HEARTCONFIGDEFAULTS_HPP_*/

Generated on Tue May 31 14:31:41 2011 for Chaste by  doxygen 1.5.5