Beispiel #1
0
    def default_parameters():
        """Initialize and return a set of default parameters for the
        splitting solver

        *Returns*
          The set of default parameters (:py:class:`dolfin.Parameters`)

        *Example of usage*::

          info(SplittingSolver.default_parameters(), True)
        """

        params = Parameters("SplittingSolver")
        params.add("enable_adjoint", True)
        params.add("theta", 0.5, 0, 1)
        params.add("apply_stimulus_current_to_pde", False)
        try:
            params.add("pde_solver", "bidomain",
                       set(["bidomain", "monodomain"]))
            params.add("ode_solver_choice", "CardiacODESolver",
                       set(["BasicCardiacODESolver", "CardiacODESolver"]))
        except:
            params.add("pde_solver", "bidomain", ["bidomain", "monodomain"])
            params.add("ode_solver_choice", "CardiacODESolver",
                       ["BasicCardiacODESolver", "CardiacODESolver"])
            pass

        # Add default parameters from ODE solver
        ode_solver_params = CardiacODESolver.default_parameters()
        ode_solver_params["scheme"] = "RL1"
        params.add(ode_solver_params)

        # Add default parameters from ODE solver
        basic_ode_solver_params = BasicCardiacODESolver.default_parameters()
        basic_ode_solver_params["V_polynomial_degree"] = 1
        basic_ode_solver_params["V_polynomial_family"] = "CG"
        params.add(basic_ode_solver_params)

        pde_solver_params = BidomainSolver.default_parameters()
        pde_solver_params["polynomial_degree"] = 1
        params.add(pde_solver_params)

        pde_solver_params = MonodomainSolver.default_parameters()
        pde_solver_params["polynomial_degree"] = 1
        params.add(pde_solver_params)

        return params
Beispiel #2
0
    def default_parameters():
        """Initialize and return a set of default parameters for the
        splitting solver

        *Returns*
          A set of parameters (:py:class:`dolfin.Parameters`)

        To inspect all the default parameters, do::

          info(SplittingSolver.default_parameters(), True)
        """

        params = Parameters("GOSSplittingSolver")

        # Have to be false as GOSS is not compatible with dolfin-adjoint
        params.add("apply_stimulus_current_to_pde", False)
        params.add("enable_adjoint", False)
        params.add("theta", 0.5, 0, 1)
        params.add("pde_solver", "bidomain", ["bidomain", "monodomain"])

        # Add default parameters from ODE solver
        ode_solver_params = goss.DOLFINODESystemSolver.default_parameters()
        ode_solver_params.rename("ode_solver")
        #ode_solver_params.add("membrane_potential", "V")
        params.add(ode_solver_params)

        pde_solver_params = BidomainSolver.default_parameters()
        pde_solver_params["polynomial_degree"] = 1
        params.add(pde_solver_params)

        pde_solver_params = MonodomainSolver.default_parameters()
        pde_solver_params["polynomial_degree"] = 1
        params.add(pde_solver_params)

        projecter_params = Projecter.default_parameters()
        params.add(projecter_params)

        return params