https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 5a8d03e2f574e21f5ab53d18706428fe12e4d28d authored by Karsten Rink on 03 January 2023, 17:39:52 UTC
Merge branch 'XyzReader' into 'master'
Tip revision: 5a8d03e
TimeDiscretizationBuilder.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2023, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#include "TimeDiscretizationBuilder.h"

#include "BaseLib/ConfigTree.h"
#include "BaseLib/Error.h"
#include "TimeDiscretization.h"

namespace NumLib
{
std::unique_ptr<TimeDiscretization> createTimeDiscretization(
    BaseLib::ConfigTree const& config)
{
    //! \ogs_file_param{prj__time_loop__processes__process__time_discretization__type}
    auto const type = config.getConfigParameter<std::string>("type");

    //! \ogs_file_param_special{prj__time_loop__processes__process__time_discretization__BackwardEuler}
    if (type == "BackwardEuler")
    {
        return std::make_unique<BackwardEuler>();
    }
    OGS_FATAL("Unrecognized time discretization type `{:s}'", type);
}
}  // namespace NumLib
back to top