PPCKO: Principal Predictive Components for Estimating an Autoregressive Operator
 
Loading...
Searching...
No Matches
meshGenerators.hpp
Go to the documentation of this file.
1// Copyright (c) 2024 Andrea Enrico Franzoni (andreaenrico.franzoni@gmail.com)
2//
3// This file is part of PPCKO
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of PPCKO and associated documentation files (the PPCKO software), to deal
7// PPCKO without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of PPCKO, and to permit persons to whom PPCKO is
10// furnished to do so, subject to the following conditions:
11//
12// PPCKO IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17// OUT OF OR IN CONNECTION WITH PPCKO OR THE USE OR OTHER DEALINGS IN
18// PPCKO.
19
20#ifndef HH_GENERATOR_HH
21#define HH_GENERATOR_HH
22#include "domain.hpp"
23#include <functional>
24#include <stdexcept>
25#include <vector>
26
27
34
35namespace Geometry
36{
37using MeshNodes = std::vector<double>;
39class OneDMeshGenerator
40{
41public:
42 OneDMeshGenerator(Geometry::Domain1D const &d) : M_domain{d} {}
43 virtual MeshNodes operator()() const = 0;
45 getDomain() const
46 {
47 return M_domain;
48 }
49 virtual ~OneDMeshGenerator() = default;
50
51protected:
52 Geometry::Domain1D M_domain;
53};
54
57class Uniform : public OneDMeshGenerator
58{
59public:
64 Uniform(Geometry::Domain1D const &domain, unsigned int num_elements)
65 : OneDMeshGenerator(domain), M_num_elements(num_elements)
66 {}
67
68
71 MeshNodes operator()() const override;
72
73private:
74 std::size_t M_num_elements;
75};
76
77} // namespace Geometry
78#endif
Definition domain.hpp:37
Uniform(Geometry::Domain1D const &domain, unsigned int num_elements)
Definition meshGenerators.hpp:64
MeshNodes operator()() const override
Call operator.
Definition meshGenerators.cpp:34
Contains the class for an unidimensioanl domain.
Definition domain.cpp:32