|
Medusa
1.1
Coordinate Free Mehless Method implementation
|
|
Go to the documentation of this file. 1 #ifndef MEDUSA_BITS_APPROXIMATIONS_OPERATORS_HPP_
2 #define MEDUSA_BITS_APPROXIMATIONS_OPERATORS_HPP_
14 template <
typename Derived>
15 template <
typename basis_t>
17 const basis_t&,
int,
typename basis_t::vector_t,
18 const std::vector<typename basis_t::vector_t>&,
typename basis_t::scalar_t)
const {
19 static_assert(!std::is_same<Derived, Derived>::value,
20 "Applying this operator to this basis not implemented.");
23 template <
typename Derived>
24 template <
typename basis_t>
26 const basis_t& basis,
int index,
const std::vector<typename basis_t::vector_t>& support,
28 return apply(basis,
typename basis_t::vector_t(0.0), index, support, scale);
31 template <
int dimension>
33 std::array<Der1<dim>,
dim> ret;
34 for (
int d = 0; d <
dim; ++d) {
39 template <
int dimension>
41 std::array<Der2<dim>,
dim*(
dim+1)/2> ret;
53 namespace operators_internal {
59 if (var < 0 || var >= 4)
return "x_" + std::to_string(var);
60 return std::string(1,
"xyzw"[var]);
65 template <
int dimension>
70 template <
int dimension>
75 template <
int dimension>
80 "Second value provided %d should be higher or equal than the first %d",
var2,
var1);
83 template <
int dimension>
85 return format(
"Der2<%d> wrt. %s and %s",
91 #endif // MEDUSA_BITS_APPROXIMATIONS_OPERATORS_HPP_
static const shape_flags d1
Indicates to calculate d1 shapes.
Root namespace for the whole library.
Scalar scalar_t
Type of the elements, alias of Scalar.
@ dim
Number of elements of this matrix.
basis_t::scalar_t applyAt0(const basis_t &basis, int index, const std::vector< typename basis_t::vector_t > &support, typename basis_t::scalar_t scale) const
Like apply, but with point equal to 0.
Der2()
Default constructor for array preallocation purposes.
#define assert_msg(cond,...)
Assert with better error reporting.
int var
Index representing derived variable (x = 0, y = 1, z = 2)
@ dim
Dimensionality of the domain.
static const shape_flags d2
Indicates to calculate d2 shapes.
Represents a family of all second derivatives.
int var2
Higher index representing derived variable (x = 0, y = 1, z = 2, ...)
Der1()
Default constructor for array preallocation purposes.
basis_t::scalar_t apply(const basis_t &basis, int index, typename basis_t::vector_t point, const std::vector< typename basis_t::vector_t > &support, typename basis_t::scalar_t scale) const
Apply this operator to a given basis function.
std::string name() const
Human readable name.
@ dim
Dimensionality of the domain.
std::string idx_to_letter(int var)
Convert variable index to its respective letter, 0 -> x, 1 -> y, etc.
int var1
Lower index representing derived variable (x = 0, y = 1, z = 2, ...)
std::string name() const
Human readable name.
static std::array< Der1< dimension >, dimension > operators()
Return an iterable of iterators represented by a family.