PPCKO: Principal Predictive Components for Estimating an Autoregressive Operator
Loading...
Searching...
No Matches
mesh.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_MESH_HH
21
#define _HH_MESH_HH
22
#include "
domain.hpp
"
23
#include "
meshGenerators.hpp
"
24
#include <functional>
25
#include <vector>
26
33
34
namespace
Geometry
35
{
36
class
Mesh1D
37
{
38
public
:
40
Mesh1D
() =
default
;
42
46
Mesh1D
(
Domain1D
const
&d,
unsigned
int
const
&n);
48
51
Mesh1D
(
Geometry::OneDMeshGenerator
const
&gf)
52
: myDomain{gf.getDomain()}, myNodes{gf()} {};
53
54
57
void
reset
(
OneDMeshGenerator
const
&mg);
58
60
unsigned
int
61
numNodes
()
const
62
{
63
return
myNodes.size();
64
}
65
66
double
67
operator[]
(
int
i)
const
68
{
69
return
myNodes[i];
70
}
71
72
std::vector<double>
73
nodes
()
const
74
{
75
return
myNodes;
76
}
77
78
std::vector<double>::iterator
79
begin
()
80
{
81
return
myNodes.begin();
82
}
83
std::vector<double>::const_iterator
84
cbegin()
const
85
{
86
return
myNodes.cbegin();
87
}
89
std::vector<double>::iterator
90
end
()
91
{
92
return
myNodes.end();
93
}
94
std::vector<double>::const_iterator
95
cend()
const
96
{
97
return
myNodes.cend();
98
}
100
103
Domain1D
104
domain
()
const
105
{
106
return
myDomain;
107
}
108
109
double
hmin
()
const
;
111
double
hmax
()
const
;
112
113
private
:
114
Domain1D
myDomain;
115
std::vector<double> myNodes;
116
};
117
118
}
// namespace Geometry
119
#endif
Geometry::Domain1D
Definition
domain.hpp:37
Geometry::Mesh1D::nodes
std::vector< double > nodes() const
The nodes.
Definition
mesh.hpp:73
Geometry::Mesh1D::end
std::vector< double >::iterator end()
To use the mesh in range based for loop I need end()
Definition
mesh.hpp:90
Geometry::Mesh1D::begin
std::vector< double >::iterator begin()
To use the mesh in range based for loop I need begin()
Definition
mesh.hpp:79
Geometry::Mesh1D::hmin
double hmin() const
The max mesh size.
Definition
mesh.cpp:48
Geometry::Mesh1D::reset
void reset(OneDMeshGenerator const &mg)
Generate mesh (it will destroy old mesh)
Definition
mesh.cpp:56
Geometry::Mesh1D::operator[]
double operator[](int i) const
The i-th node.
Definition
mesh.hpp:67
Geometry::Mesh1D::numNodes
unsigned int numNodes() const
Number of nodes.
Definition
mesh.hpp:61
Geometry::Mesh1D::hmax
double hmax() const
The max mesh size.
Definition
mesh.cpp:40
Geometry::Mesh1D::Mesh1D
Mesh1D()=default
Default constructor is defaulted.
Geometry::Mesh1D::Mesh1D
Mesh1D(Geometry::OneDMeshGenerator const &gf)
Constructor for an variably spaced mesh.
Definition
mesh.hpp:51
Geometry::Mesh1D::domain
Domain1D domain() const
I return a copy of the DOmain1D.
Definition
mesh.hpp:104
Geometry::OneDMeshGenerator
General interface.
Definition
meshGenerators.hpp:40
domain.hpp
Contains the class for an unidimensioanl domain.
meshGenerators.hpp
Contains the class for generating an unidimensional mesh. Little modification: retained only the part...
Geometry
Definition
domain.cpp:32
src
mesh.hpp
Generated by
1.13.1