From 88ca2616d03bad0cd3264e7acc648e0c3a6a27eb Mon Sep 17 00:00:00 2001 From: Christoph Lehmann <christoph.lehmann@ufz.de> Date: Wed, 9 Feb 2022 10:45:37 +0100 Subject: [PATCH] [NL] Added generic integration method --- .../Integration/GenericIntegrationMethod.h | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 NumLib/Fem/Integration/GenericIntegrationMethod.h diff --git a/NumLib/Fem/Integration/GenericIntegrationMethod.h b/NumLib/Fem/Integration/GenericIntegrationMethod.h new file mode 100644 index 00000000000..b20030db9ec --- /dev/null +++ b/NumLib/Fem/Integration/GenericIntegrationMethod.h @@ -0,0 +1,53 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2022, 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 <vector> + +#include "MathLib/WeightedPoint.h" + +namespace NumLib +{ +//! Provides data for arbitrary numerical integration methods of any integration +//! order. +//! +//! This class basically holds a collection of integration points and +//! integration weights. +class GenericIntegrationMethod final +{ +public: + GenericIntegrationMethod(unsigned const order, + std::vector<MathLib::WeightedPoint>&& points) + : order_{order}, points_{std::move(points)} + { + } + + unsigned getIntegrationOrder() const { return order_; } + + unsigned getNumberOfPoints() const { return points_.size(); } + + MathLib::WeightedPoint const& getWeightedPoint(unsigned const igp) const + { + return points_[igp]; + } + + // forbid accidental copies + GenericIntegrationMethod(GenericIntegrationMethod const&) = delete; + GenericIntegrationMethod& operator=(GenericIntegrationMethod const&) = + delete; + GenericIntegrationMethod(GenericIntegrationMethod&&) = default; + GenericIntegrationMethod& operator=(GenericIntegrationMethod&&) = default; + +private: + unsigned order_; + + std::vector<MathLib::WeightedPoint> points_; +}; +} // namespace NumLib -- GitLab