suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
IntegrationPlan.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2026 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
61#ifndef INTEGRATIONPLAN_H
62#define INTEGRATIONPLAN_H
63
64#include <armadillo/arma>
65
66class IntegrationPlan final {
67public:
68 enum class Type {
69 GAUSS,
70 HERMITE,
72 LOBATTO,
73 RADAU,
75 IRONS,
77 };
78
79private:
80 arma::mat int_pts;
81
82 template<Type> void generate(unsigned, unsigned) { throw std::invalid_argument("not supported"); }
83
84public:
85 const unsigned n_rows = 0;
86 const unsigned n_cols = 0;
87
88 explicit IntegrationPlan(unsigned, unsigned, Type);
89
90 [[nodiscard]] const arma::mat& get_data() const;
91
92 double operator()(unsigned, unsigned) const;
93
94 void print() const;
95};
96
97template<> void IntegrationPlan::generate<IntegrationPlan::Type::GAUSS>(unsigned, unsigned);
98template<> void IntegrationPlan::generate<IntegrationPlan::Type::HERMITE>(unsigned, unsigned);
99template<> void IntegrationPlan::generate<IntegrationPlan::Type::CHEBYSHEV>(unsigned, unsigned);
100template<> void IntegrationPlan::generate<IntegrationPlan::Type::LOBATTO>(unsigned, unsigned);
101template<> void IntegrationPlan::generate<IntegrationPlan::Type::RADAU>(unsigned, unsigned);
102template<> void IntegrationPlan::generate<IntegrationPlan::Type::LAGUERRE>(unsigned, unsigned);
103template<> void IntegrationPlan::generate<IntegrationPlan::Type::IRONS>(unsigned, unsigned);
104template<> void IntegrationPlan::generate<IntegrationPlan::Type::TRIANGLE>(unsigned, unsigned);
105
106#endif
107
An IntegrationPlan class.
Definition IntegrationPlan.h:66
double operator()(unsigned, unsigned) const
Definition IntegrationPlan.cpp:1846
const arma::mat & get_data() const
Definition IntegrationPlan.cpp:1844
Type
Definition IntegrationPlan.h:68
void print() const
Definition IntegrationPlan.cpp:1848
const unsigned n_rows
Definition IntegrationPlan.h:85
const unsigned n_cols
Definition IntegrationPlan.h:86