HeartConfigDefaults.hpp

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
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 
00079 boost::shared_ptr<cp::chaste_parameters_type> CreateDefaultParameters()
00080 {
00081     // Simulation parameters
00082     cp::simulation_type simulation_params;
00083     simulation_params.SpaceDimension().set(3);
00084     cp::domain_type domain("Mono");
00085     simulation_params.Domain().set(domain);
00086     cp::ionic_model_selection_type default_ionic_model;
00087     cp::ionic_models_available_type ionic_model("LuoRudyI");
00088     default_ionic_model.Hardcoded().set(ionic_model);
00089     cp::ionic_models_type ionic_models(default_ionic_model);
00090     simulation_params.IonicModels().set(ionic_models);
00091     simulation_params.OutputDirectory().set("ChasteResults");
00092     simulation_params.OutputFilenamePrefix().set("SimulationResults");
00093     
00094     // Physiological parameters
00095     cp::physiological_type phys_params;
00096     XSD_CREATE_WITH_FIXED_ATTR3(cp::conductivities_type, intra_conductivities,
00097                                 1.75, 1.75, 1.75, "mS/cm");
00098     phys_params.IntracellularConductivities().set(intra_conductivities);
00099     XSD_CREATE_WITH_FIXED_ATTR3(cp::conductivities_type, extra_conductivities,
00100                                 7.0, 7.0, 7.0, "mS/cm");
00101     phys_params.ExtracellularConductivities().set(extra_conductivities);
00102     XSD_CREATE_WITH_FIXED_ATTR1(cp::conductivity_type, bath_conductivity, 7.0, "mS/cm");
00103     phys_params.BathConductivity().set(bath_conductivity);
00104     XSD_CREATE_WITH_FIXED_ATTR1(cp::inverse_length_type, surface_area_to_volume_ratio, 1400, "1/cm");
00105     phys_params.SurfaceAreaToVolumeRatio().set(surface_area_to_volume_ratio);
00106     XSD_CREATE_WITH_FIXED_ATTR1(cp::capacitance_type, capacitance, 1.0, "uF/cm^2");
00107     phys_params.Capacitance().set(capacitance);
00108     
00109     // Numerical parameters
00110     cp::numerical_type numerical_params;
00111     XSD_CREATE_WITH_FIXED_ATTR3(cp::time_steps_type, timesteps, 0.01, 0.01, 0.01, "ms");
00112     cp::ksp_tolerances_type tolerances;
00113     tolerances.KSPAbsolute().set(2e-4);
00114     cp::ksp_solver_type ksp_solver("cg");
00115     cp::ksp_preconditioner_type ksp_precond("bjacobi");
00116     numerical_params.TimeSteps().set(timesteps);
00117     numerical_params.KSPTolerances().set(tolerances);
00118     numerical_params.KSPSolver().set(ksp_solver);
00119     numerical_params.KSPPreconditioner().set(ksp_precond);
00120     
00121     // Postprocessing
00122     cp::postprocessing_type postproc;
00123     
00124     // Full default parameters
00125     boost::shared_ptr<cp::chaste_parameters_type> p_defaults(new cp::chaste_parameters_type(phys_params, numerical_params));
00126     p_defaults->Simulation().set(simulation_params);
00127     p_defaults->PostProcessing().set(postproc);
00128     return p_defaults;
00129 }
00130 
00131 #endif /*HEARTCONFIGDEFAULTS_HPP_*/

Generated on Mon Nov 1 12:35:17 2010 for Chaste by  doxygen 1.5.5