Manicore
Library to implement schemes on n-dimensionnal manifolds.
definitions.hpp
Go to the documentation of this file.
1 #ifndef DEFINITIONS_HPP_INCLUDED
2 #define DEFINITIONS_HPP_INCLUDED
3 
4 #include <Eigen/Dense>
5 
6 #include <array>
7 
12 namespace Manicore {
13 
15  template<size_t d>
16  using Simplex = std::array<Eigen::Vector<double,d>,d+1>;
17 
19 
22  template<size_t dimension,size_t d>
23  struct ParametrizedMap {
25  virtual Eigen::Vector<double,dimension> I(Eigen::Vector<double,d> const &) const = 0;
27  virtual Eigen::Vector<double,d> J(Eigen::Vector<double,dimension> const &) const = 0;
29  std::vector<double> _extra;
30  virtual ~ParametrizedMap() = default;
31  };
32 
34 
37  template<size_t d1,size_t d2>
40 
41  virtual Eigen::Matrix<double,d1,d2> DI(Eigen::Vector<double,d2> const &) const = 0;
43 
44  virtual Eigen::Matrix<double,d2,d1> DJ(Eigen::Vector<double,d1> const &) const = 0;
46  std::vector<double> _extra;
47  virtual ~ParametrizedDerivedMap() = default;
48  };
49 
51 
53  template<size_t dimension>
56  virtual Eigen::Matrix<double,dimension,dimension> metric(Eigen::Vector<double,dimension> const &) const = 0;
58 
59  virtual Eigen::Matrix<double,dimension,dimension> metric_inv(Eigen::Vector<double,dimension> const &) const = 0;
61 
62  virtual double volume(Eigen::Vector<double,dimension> const &) const = 0;
64  std::vector<double> _extra;
68 
69  const int orientation = 0;
70  virtual ~ParametrizedMetricMap() = default;
71  };
72 
74  template<size_t dimension,size_t d>
75  ParametrizedMap<dimension,d> *DefaultMapping(size_t id) {return nullptr;}
77  template<size_t dimension,size_t d>
79 
80 } // namespace
81 
82 #endif
83 
Definition: maxwell.hpp:21
ParametrizedMap< dimension, d > * DefaultMapping(size_t id)
Do nothing mapping (always return null)
Definition: definitions.hpp:75
std::array< Eigen::Vector< double, d >, d+1 > Simplex
Array of d+1 points of .
Definition: definitions.hpp:16
ParametrizedDerivedMap< dimension, d > * DefaultDerivedMapping(size_t id)
Do nothing mapping (always return null)
Definition: definitions.hpp:78
First order differentials of the parametrizations.
Definition: definitions.hpp:38
virtual ~ParametrizedDerivedMap()=default
std::vector< double > _extra
Optional parameters that may be used within the class.
Definition: definitions.hpp:46
virtual Eigen::Matrix< double, d1, d2 > DI(Eigen::Vector< double, d2 > const &) const =0
Differential of the parametrization.
virtual Eigen::Matrix< double, d2, d1 > DJ(Eigen::Vector< double, d1 > const &) const =0
Differential of the inverse mapping.
Used for the parametrization of the mesh elements.
Definition: definitions.hpp:23
virtual ~ParametrizedMap()=default
std::vector< double > _extra
Optional parameters that may be used within the class.
Definition: definitions.hpp:29
virtual Eigen::Vector< double, dimension > I(Eigen::Vector< double, d > const &) const =0
Parametrization from a reference element to a chart.
virtual Eigen::Vector< double, d > J(Eigen::Vector< double, dimension > const &) const =0
Inverse mapping from a chart to the reference element.
Used to specify the ambient metric.
Definition: definitions.hpp:54
ParametrizedMetricMap(int o)
Allows setting the orientation when sub classing.
Definition: definitions.hpp:66
const int orientation
Orientation of the chart.
Definition: definitions.hpp:69
std::vector< double > _extra
Optional parameters that may be used within the class.
Definition: definitions.hpp:64
virtual Eigen::Matrix< double, dimension, dimension > metric(Eigen::Vector< double, dimension > const &) const =0
Metric of the tangent space on a chart.
virtual double volume(Eigen::Vector< double, dimension > const &) const =0
Scaling of the volume form on a chart.
virtual Eigen::Matrix< double, dimension, dimension > metric_inv(Eigen::Vector< double, dimension > const &) const =0
Metric of the cotangent space on a chart.
virtual ~ParametrizedMetricMap()=default