https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: bb62934ceabb175dea711859a31a148914984ab7 authored by Tom Fischer on 06 March 2023, 20:25:03 UTC
Merge branch 'NodePartitionedMeshAndPartitioningImprovements' into 'master'
Tip revision: bb62934
IntegrationMethodRegistry.h
/**
 * \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
 */

#pragma once

#include <typeindex>

#include "GenericIntegrationMethod.h"

namespace NumLib
{
//! A named type avoiding that the integration order is confused with other
//! integral types when passed as function argument.
struct IntegrationOrder
{
    explicit IntegrationOrder(unsigned const order_) : order{order_} {}

    unsigned order;
};

namespace IntegrationMethodRegistry
{
//! Provides the default integration method for a given mesh element type and a
//! given integration order.
GenericIntegrationMethod const& getIntegrationMethod(
    std::type_index const mesh_element_type, IntegrationOrder const order);

//! Templated version of above method. Provided for convenience.
template <typename MeshElement>
GenericIntegrationMethod const& getIntegrationMethod(
    IntegrationOrder const order)
{
    return getIntegrationMethod(std::type_index(typeid(MeshElement)), order);
}
}  // namespace IntegrationMethodRegistry
}  // namespace NumLib
back to top