Revision 063435a1f0a70abd32e6da9b431221b984114d87 authored by Haibing Shao on 24 September 2021, 14:21:01 UTC, committed by Haibing Shao on 24 September 2021, 14:45:02 UTC
change definition of postTimeStepConcreteProcess

successfully running (but tespySolver commented)

State for building release version for additional tests (NOT final; tespySolver commented out)

using the newly added switch


Fixed server communication switch (OR instead of AND)

correct the naming


Extended "call BHEPythonBoundarycondition" clause

cosmetic change of process file

Code cosmetics #2

clang format the process file

clean up the process file

Apply 1 suggestion(s) to 1 file(s)
Apply 1 suggestion(s) to 1 file(s)
remove comments in process file
1 parent 50b953e
Raw File
CreateSearchLength.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, 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 "CreateSearchLength.h"

#include "BaseLib/ConfigTree.h"
#include "BaseLib/Error.h"
#include "MeshGeoToolsLib/HeuristicSearchLength.h"
#include "MeshGeoToolsLib/SearchLength.h"

namespace MeshGeoToolsLib
{
std::unique_ptr<MeshGeoToolsLib::SearchLength> createSearchLengthAlgorithm(
    BaseLib::ConfigTree const& external_config, MeshLib::Mesh const& mesh)
{
    std::optional<BaseLib::ConfigTree> config =
        //! \ogs_file_param{prj__search_length_algorithm}
        external_config.getConfigSubtreeOptional("search_length_algorithm");

    if (!config)
    {
        return std::make_unique<MeshGeoToolsLib::SearchLength>();
    }

    //! \ogs_file_param{prj__search_length_algorithm__type}
    std::string const type = config->getConfigParameter<std::string>("type");

    //! \ogs_file_param_special{prj__search_length_algorithm__fixed}
    if (type == "fixed")
    {
        //! \ogs_file_param{prj__search_length_algorithm__fixed__value}
        auto const length = config->getConfigParameter<double>("value");
        return std::make_unique<MeshGeoToolsLib::SearchLength>(length);
    }
    if (type == "heuristic")
    {
        //! \ogs_file_param_special{prj__search_length_algorithm__heuristic}
        return std::make_unique<HeuristicSearchLength>(mesh);
    }
    OGS_FATAL("Unknown search length algorithm type '{:s}'.", type);
}

}  // end namespace MeshGeoToolsLib
back to top