Medusa  1.1
Coordinate Free Mehless Method implementation
ExplicitVectorOperators_fwd.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_OPERATORS_EXPLICITVECTOROPERATORS_FWD_HPP_
2 #define MEDUSA_BITS_OPERATORS_EXPLICITVECTOROPERATORS_FWD_HPP_
3 
11 #include <medusa/Config.hpp>
12 #include <Eigen/Core>
15 
16 namespace mm {
17 
37 template <class shape_storage_type>
39  public:
40  typedef shape_storage_type shape_storage_t;
41  typedef typename shape_storage_t::vector_t vector_t;
43  enum { dim = shape_storage_t::dim };
45 
46  private:
49 
50  public:
52  ExplicitVectorOperators() : ss(nullptr) {}
62 
69  void setShapes(const shape_storage_t& shape_storage_) { ss = &shape_storage_; }
70 
72  bool hasShapes() const { return ss != nullptr; }
73 
86  template <class vector_field_t>
87  typename vector_type<vector_field_t>::type lap(const vector_field_t& u, int node) const {
88  return apply<Lap<dim>, vector_field_t>(u, node, {});
89  }
90 
103  template <typename op_family_t, typename vector_field_t>
105  const vector_field_t& u, int node, typename op_family_t::operator_t o) const;
106 
107 
109  template <typename op_family_t, typename vector_field_t>
110  typename vector_type<vector_field_t>::type apply(const vector_field_t& u, int node) const {
111  return apply<op_family_t, vector_field_t>(u, node, {});
112  }
113 
114 
128  template <class vector_field_t>
131  grad(const vector_field_t& u, int node) const;
132 
142  template <class vector_field_t>
144  const vector_field_t& u, int node) const;
145 
153  template <class vector_field_t>
154  typename vector_type<vector_field_t>::type curl(const vector_field_t& u, int node) const;
155 
169  template <class vector_field_t>
170  typename vector_type<vector_field_t>::type graddiv(const vector_field_t& u, int node) const;
210  template <class vector_field_t>
211  typename vector_type<vector_field_t>::type neumann(const vector_field_t& u, int node,
212  const vector_t& normal, typename vector_type<vector_field_t>::type val) const;
213 
215  template <typename S>
216  friend std::ostream& operator<<(std::ostream& os, const ExplicitVectorOperators<S>& op);
217 };
218 
219 } // namespace mm
220 
221 #endif // MEDUSA_BITS_OPERATORS_EXPLICITVECTOROPERATORS_FWD_HPP_
mm::ExplicitVectorOperators::ss
const shape_storage_t * ss
Pointer to shape storage, but name is shortened for readability.
Definition: ExplicitVectorOperators_fwd.hpp:48
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
scalar_t
Scalar scalar_t
Type of the elements, alias of Scalar.
Definition: MatrixBaseAddons.hpp:16
mm::vector_type::type
void type
By default invalid underlying vector type. Must be specified for each type separately.
Definition: traits.hpp:31
mm::ExplicitVectorOperators::scalar_t
shape_storage_t::scalar_t scalar_t
Scalar type.
Definition: ExplicitVectorOperators_fwd.hpp:42
mm::ExplicitVectorOperators::graddiv
vector_type< vector_field_t >::type graddiv(const vector_field_t &u, int node) const
Returns gradient of divergence of a vector field u in in node with index node.
dim
@ dim
Number of elements of this matrix.
Definition: MatrixBaseAddons.hpp:14
mm::ExplicitVectorOperators::vector_t
shape_storage_t::vector_t vector_t
Vector type.
Definition: ExplicitVectorOperators_fwd.hpp:41
mm::ExplicitVectorOperators::setShapes
void setShapes(const shape_storage_t &shape_storage_)
Sets a new shape storage from which this operators are generated.
Definition: ExplicitVectorOperators_fwd.hpp:69
mm::ExplicitVectorOperators
A class for evaluating typical operators needed in spatial discretization.
Definition: ExplicitVectorOperators_fwd.hpp:38
Config.hpp
mm::ExplicitVectorOperators::dim
@ dim
Dimensionality of the function domain.
Definition: ExplicitVectorOperators_fwd.hpp:44
Operators_fwd.hpp
mm::vector_type
Type trait for vector fields to obtain their underlying vector type.
Definition: traits.hpp:28
mm::ExplicitVectorOperators::operator<<
friend std::ostream & operator<<(std::ostream &os, const ExplicitVectorOperators< S > &op)
Output basic info about given operators.
Definition: ExplicitVectorOperators.hpp:151
mm::ExplicitVectorOperators::ExplicitVectorOperators
ExplicitVectorOperators(const shape_storage_t &ss)
Construct explicit vector operators over given shape storage.
Definition: ExplicitVectorOperators_fwd.hpp:61
mm::ExplicitVectorOperators::curl
vector_type< vector_field_t >::type curl(const vector_field_t &u, int node) const
Returns curl of a vector field u in node with index node.
mm::ExplicitVectorOperators::neumann
vector_type< vector_field_t >::type neumann(const vector_field_t &u, int node, const vector_t &normal, typename vector_type< vector_field_t >::type val) const
This is a vectorised version of ExplicitOperators::neumann.
mm::ExplicitVectorOperators::shape_storage_t
shape_storage_type shape_storage_t
Type of shape storage.
Definition: ExplicitVectorOperators_fwd.hpp:40
mm::ExplicitVectorOperators::hasShapes
bool hasShapes() const
Returns true if operators have a non-null pointer to storage and false otherwise.
Definition: ExplicitVectorOperators_fwd.hpp:72
mm::ExplicitVectorOperators::grad
Eigen::Matrix< typename vector_type< vector_field_t >::type::scalar_t, vector_type< vector_field_t >::type::dim, dim > grad(const vector_field_t &u, int node) const
Returns gradient of vector field u in node with index node.
mm::ExplicitVectorOperators::ExplicitVectorOperators
ExplicitVectorOperators()
Construct empty explicit vector operators.
Definition: ExplicitVectorOperators_fwd.hpp:52
mm::ExplicitVectorOperators::apply
vector_type< vector_field_t >::type apply(const vector_field_t &u, int node) const
Overload for default constructible operator.
Definition: ExplicitVectorOperators_fwd.hpp:110
mm::ExplicitVectorOperators::div
vector_type< vector_field_t >::type::scalar_t div(const vector_field_t &u, int node) const
Returns divergence of a vector field u in in node with index node.
traits.hpp
mm::ExplicitVectorOperators::lap
vector_type< vector_field_t >::type lap(const vector_field_t &u, int node) const
Returns Laplacian of vector field u in node with index node.
Definition: ExplicitVectorOperators_fwd.hpp:87
mm::ExplicitVectorOperators::apply
vector_type< vector_field_t >::type apply(const vector_field_t &u, int node, typename op_family_t::operator_t o) const
Returns an approximation of applying the requested operator to each component of field u at node node...