Medusa  1.1
Coordinate Free Mehless Method implementation
ImplicitVectorOperators_fwd.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_OPERATORS_IMPLICITVECTOROPERATORS_FWD_HPP_
2 #define MEDUSA_BITS_OPERATORS_IMPLICITVECTOROPERATORS_FWD_HPP_
3 
11 #include <medusa/Config.hpp>
14 
15 namespace mm {
16 
43 template <class shape_storage_type, class matrix_type, class rhs_type>
45  public:
46  typedef shape_storage_type shape_storage_t;
47  typedef matrix_type matrix_t;
48  typedef rhs_type rhs_t;
49  typedef typename shape_storage_t::vector_t domain_vector_t;
53  typedef typename matrix_t::Scalar scalar_t;
57  typedef Eigen::Matrix<scalar_t, dim, 1> vector_t;
58 
59  private:
64  int row_offset;
65  int col_offset;
66 
68  void addToM(int i, int j, scalar_t v) {
69  assert_msg(v == v, "You tried to set M(%d, %d) to NAN. Check your computes shapes.",
70  row_offset+i, col_offset+j);
71  M->coeffRef(row_offset+i, col_offset+j) += v;
72  }
74  void addToRhs(int i, const vector_t& v) {
75  assert_msg(!v.array().isNaN().any(),
76  "You tried to set rhs(%d) to NaN. Check you computed shapes.", row_offset+i);
77  for (int d = 0; d < dim; ++d) {
78  rhs->operator[](row_offset + d * ss->size() + i) += v[d];
79  }
80  }
81 
82  template <typename derived_t> class VecOpBase; // Forward declaration needed.
83 
92  class RowVecOp {
93  friend class ImplicitVectorOperators;
94  protected:
96  int row_;
100  int row() const { return op.row_offset + row_; }
101  public:
108  RowVecOp operator+(const RowVecOp& other) const {
109  assert_msg(row() == other.row(),
110  "Cannot add together terms for different matrix rows %d and %d.",
111  row(), other.row());
112  return *this;
113  }
115  template <typename derived_t>
116  RowVecOp operator+(const VecOpBase<derived_t>& right) { return *this + right.eval(); }
118  void operator=(const vector_t& value) {
119  op.addToRhs(row_, value);
120  }
121  };
122 
130  template <typename derived_t>
131  class VecOpBase {
132  protected:
134  int node;
135  int row;
138  : op(op), node(node), row(row) {}
139  public:
145  RowVecOp eval(scalar_t alpha) const {
146  return static_cast<const derived_t &>(*this).eval(alpha);
147  }
149  RowVecOp eval() const { return eval(1.0); }
151  void operator=(const vector_t& x) { eval() = x; }
153  RowVecOp operator*(scalar_t alpha) { return eval(alpha); }
155  RowVecOp operator+(RowVecOp right) { return eval() + right; }
157  RowVecOp operator-() { return eval(-1.0); }
159  template <typename other_derived_t>
160  RowVecOp operator+(const VecOpBase<other_derived_t>& right) { return eval()+right.eval(); }
162  friend RowVecOp operator*(scalar_t alpha, const VecOpBase& op) { return op.eval(alpha); }
163  };
164 
166 #define USE_VECTOR_BASE(Name) \
167  private: \
168  using VecOpBase<Name>::op; \
169  using VecOpBase<Name>::node; \
170  using VecOpBase<Name>::row; \
171  using VecOpBase<Name>::VecOpBase; \
172  friend class ImplicitVectorOperators; \
173  public: \
174  using VecOpBase<Name>::eval; \
175  using VecOpBase<Name>::operator=;
176 
178  class ValueOp : public VecOpBase<ValueOp> {
181  RowVecOp eval(scalar_t alpha) const {
182  for (int d = 0; d < dim; ++d) {
183  op.addToM(row + d*op.ss->size(), node + d*op.ss->size(), alpha);
184  }
185  return RowVecOp(op, row);
186  }
187  };
188 
190  template <typename op_family_t>
191  class BasicOp : public VecOpBase<BasicOp<op_family_t>> {
193  private:
194  typename op_family_t::operator_t o;
195  public:
197  BasicOp(ImplicitVectorOperators& op, int node, int row, typename op_family_t::operator_t o)
198  : VecOpBase<BasicOp<op_family_t>>(op, node, row), o(o) {}
200  RowVecOp eval(scalar_t alpha) const {
201  int idx = op_family_t::index(o);
202  for (int d = 0; d < dim; ++d) {
203  for (int i = 0; i < op.ss->supportSize(node); ++i) {
204  op.addToM(d*op.ss->size() + row, d*op.ss->size() + op.ss->support(node, i),
205  alpha * op.ss->template get<op_family_t>(idx, node, i));
206  }
207  }
208  return RowVecOp(op, row);
209  }
210  };
211 
217  class GradOp : public VecOpBase<GradOp> {
219  private:
223  VecOpBase<GradOp>(op, node, row), vec(vec) {}
224  public:
226  RowVecOp eval(scalar_t alpha) const {
227  for (int i = 0; i < op.ss->supportSize(node); ++i) {
228  scalar_t shape_value = 0;
229  for (int var = 0; var < dim; ++var) {
230  shape_value += vec[var] * op.ss->d1(var, node, i);
231  }
232  for (int d = 0; d < dim; ++d) {
233  op.addToM(d*op.ss->size() + row, d*op.ss->size() + op.ss->support(node, i),
234  alpha*shape_value);
235  }
236  }
237  return RowVecOp(op, row);
238  }
239  };
240 
245  class GradDivOp : public VecOpBase<GradDivOp> {
248  RowVecOp eval(scalar_t alpha) const {
249  // Implicit equation is for all d: \sum_k \sum_j \chi_djk u_j(s_k) = v_d(s)
250  for (int d = 0; d < dim; ++d) {
251  for (int k = 0; k < op.ss->supportSize(node); ++k) {
252  for (int j = 0; j < dim; ++j) { // loop over dimensions
253  int dmin = std::min(d, j);
254  int dmax = std::max(d, j);
255  op.addToM(d*op.ss->size() + row,
256  j*op.ss->size() + op.ss->support(node, k),
257  alpha * op.ss->d2(dmin, dmax, node, k));
258  }
259  }
260  }
261  return RowVecOp(op, row);
262  }
263  };
264 
266  class TractionOp : public VecOpBase<TractionOp> {
268  private:
270  mu;
272 
275  const domain_vector_t& normal) :
277  public:
279  RowVecOp eval(scalar_t alpha) const {
280  for (int i = 0; i < dim; ++i) { // which equation of sigma.n = t
281  for (int j = 0; j < dim; ++j) { // computation of sigma (lam tr(eps) I) part
282  op.eq(i).c(j).der1(node, j, row).eval(alpha*lam*normal(i));
283  }
284  for (int j = 0; j < dim; ++j) { // computation of sigma (2 mu eps) part
285  op.eq(i).c(i).der1(node, j, row).eval(alpha*mu*normal(j));
286  op.eq(i).c(j).der1(node, i, row).eval(alpha*mu*normal(j));
287  }
288  }
289  return RowVecOp(op, row);
290  }
291  };
292 
294  class Equation {
296  int eq_ixd;
297  friend class ImplicitVectorOperators;
298 
301  assert_msg(0 <= idx && idx < op.dim, "Equation number %d out of range [0, %d).",
302  idx, dim);
303  }
304 
305  public:
308  assert_msg(0 <= comp && comp < dim,
309  "Dimension %d out of range, expected in range [0, %d).", comp, dim);
311  sop.setProblem(*op.M, *op.rhs, op.row_offset + eq_ixd*op.ss->size(),
312  op.col_offset + comp*op.ss->size());
313  return sop;
314  }
315  };
316 
317  public:
319  ImplicitVectorOperators() : ss(nullptr), M(nullptr), rhs(nullptr), row_offset(0),
320  col_offset(0) {}
322  explicit ImplicitVectorOperators(const shape_storage_t& ss) : ss(&ss), M(nullptr), rhs(nullptr),
323  row_offset(0), col_offset(0) {}
340  int row_offset = 0, int col_offset = 0);
341 
343  void setProblem(matrix_t& M, rhs_t& rhs, int row_offset = 0, int col_offset = 0) {
348  }
351  assert_msg(0 <= row_offset, "Row offset cannot be negative, got %d.", row_offset);
353  }
356  assert_msg(0 <= col_offset, "Col offset cannot be negative, got %d.", col_offset);
358  }
359 
361  bool hasShapes() const { return ss != nullptr; }
363  bool hasMatrix() const { return M != nullptr; }
365  bool hasRhs() const { return rhs != nullptr; }
374  Equation eq(int num) {
375  assert_msg(0 <= num && num < dim, "Equation must be in range [0, %d), got %d", num, dim);
376  return Equation(*this, num);
377  }
378 
396  ValueOp value(int node, int row) { return ValueOp(*this, node, row); }
398  ValueOp value(int node) { return value(node, node); }
399 
420  BasicOp<Lap<dim>> lap(int node, int row) { return BasicOp<Lap<dim>>(*this, node, row); }
422  BasicOp<Lap<dim>> lap(int node) { return lap(node, node); }
423 
432  template <typename op_family_t>
433  BasicOp<op_family_t> apply(int node, typename op_family_t::operator_t o, int row) {
434  return BasicOp<op_family_t>(*this, node, row, o);
435  }
436 
438  template <typename op_family_t>
439  BasicOp<op_family_t> apply(int node, typename op_family_t::operator_t o) {
440  return apply<op_family_t>(node, o, node);
441  }
442 
444  template <typename op_family_t>
445  BasicOp<op_family_t> apply(int node) { return apply<op_family_t>(node, {}, node); }
446 
465  GradOp grad(int node, const domain_vector_t& v, int row) { return GradOp(*this, node, row, v); }
467  GradOp grad(int node, const domain_vector_t& v) { return grad(node, v, node); }
468 
486  GradDivOp graddiv(int node, int row) { return GradDivOp(*this, node, row); }
488  GradDivOp graddiv(int node) { return graddiv(node, node); }
489 
505  GradOp neumann(int node, const domain_vector_t& unit_normal, int row) {
506  assert_msg(std::abs(unit_normal.norm() - 1.0) < 1e-13,
507  "Normal %s is not of unit length, got %.16f.", unit_normal, unit_normal.norm());
508  return grad(node, unit_normal, row);
509  }
511  GradOp neumann(int node, const domain_vector_t& n) { return neumann(node, n, node); }
512 
532  TractionOp traction(int node, scalar_t lam, scalar_t mu, const domain_vector_t& unit_normal,
533  int row) {
534  assert_msg(std::abs(unit_normal.norm() - 1.0) < 1e-13,
535  "Normal %s is not of unit length, got %.16f.", unit_normal, unit_normal.norm());
536  return TractionOp(*this, node, row, lam, mu, unit_normal);
537  }
539  TractionOp traction(int node, scalar_t lam, scalar_t mu, const domain_vector_t& n) {
540  return traction(node, lam, mu, n, node);
541  }
542 
544  template <typename S, typename M, typename R>
545  friend std::ostream& operator<<(std::ostream& os, const ImplicitVectorOperators<S, M, R>& op);
546 };
547 
548 } // namespace mm
549 
550 #endif // MEDUSA_BITS_OPERATORS_IMPLICITVECTOROPERATORS_FWD_HPP_
mm::ImplicitVectorOperators::BasicOp::eval
RowVecOp eval(scalar_t alpha) const
Evaluate this operator.
Definition: ImplicitVectorOperators_fwd.hpp:200
mm::ImplicitVectorOperators::neumann
GradOp neumann(int node, const domain_vector_t &unit_normal, int row)
Sets neumann boundary conditions in node node.
Definition: ImplicitVectorOperators_fwd.hpp:505
mm::ImplicitVectorOperators::hasMatrix
bool hasMatrix() const
Returns true if operators have a non-null pointer to problem matrix.
Definition: ImplicitVectorOperators_fwd.hpp:363
mm::ImplicitVectorOperators::ImplicitVectorOperators
ImplicitVectorOperators(const shape_storage_t &ss)
Set only shape storage, the rest as default constructor.
Definition: ImplicitVectorOperators_fwd.hpp:322
mm::ImplicitVectorOperators::rhs_t
rhs_type rhs_t
Right hand side type.
Definition: ImplicitVectorOperators_fwd.hpp:48
mm::ImplicitVectorOperators::traction
TractionOp traction(int node, scalar_t lam, scalar_t mu, const domain_vector_t &n)
Same as traction with row equal to current node.
Definition: ImplicitVectorOperators_fwd.hpp:539
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
mm::ImplicitVectorOperators::hasRhs
bool hasRhs() const
Returns true if operators have a non-null pointer to problem right hand side.
Definition: ImplicitVectorOperators_fwd.hpp:365
mm::ImplicitVectorOperators::RowVecOp::row
int row() const
Return absolute index of this row operation.
Definition: ImplicitVectorOperators_fwd.hpp:100
mm::ImplicitVectorOperators::apply
BasicOp< op_family_t > apply(int node, typename op_family_t::operator_t o)
Same as apply with row equal to current node.
Definition: ImplicitVectorOperators_fwd.hpp:439
mm::ImplicitVectorOperators::VecOpBase::operator+
RowVecOp operator+(RowVecOp right)
Combine this operation with another row operation.
Definition: ImplicitVectorOperators_fwd.hpp:155
mm::ImplicitVectorOperators::VecOpBase::eval
RowVecOp eval(scalar_t alpha) const
Write appropriate coefficients for this operation to the matrix.
Definition: ImplicitVectorOperators_fwd.hpp:145
mm::ImplicitVectorOperators::rhs
rhs_t * rhs
Pointer to right hand side.
Definition: ImplicitVectorOperators_fwd.hpp:63
mm::ImplicitVectorOperators::value
ValueOp value(int node, int row)
Sets implicit equation that value of a vector field is equal to some other value.
Definition: ImplicitVectorOperators_fwd.hpp:396
mm::ImplicitVectorOperators::Equation::op
ImplicitVectorOperators & op
Reference to underlying operators.
Definition: ImplicitVectorOperators_fwd.hpp:295
mm::ImplicitVectorOperators::Equation::Equation
Equation(ImplicitVectorOperators &op, int idx)
Create an equation with given index.
Definition: ImplicitVectorOperators_fwd.hpp:300
mm::ImplicitVectorOperators::RowVecOp::operator+
RowVecOp operator+(const RowVecOp &other) const
Add two row operations together.
Definition: ImplicitVectorOperators_fwd.hpp:108
mm::ImplicitVectorOperators::setRowOffset
void setRowOffset(int row_offset)
Sets row offset for given matrix, treating it as is the first row had index row_offset.
Definition: ImplicitVectorOperators_fwd.hpp:350
mm::ImplicitVectorOperators::matrix_t
matrix_type matrix_t
Matrix type.
Definition: ImplicitVectorOperators_fwd.hpp:47
mm::ImplicitVectorOperators::grad
GradOp grad(int node, const domain_vector_t &v, int row)
Sets implicit equation that gradient of a vector field along v is equal to some other value.
Definition: ImplicitVectorOperators_fwd.hpp:465
mm::ImplicitVectorOperators::addToM
void addToM(int i, int j, scalar_t v)
Adds v to M(i, j), i.e. M(i, j) += v.
Definition: ImplicitVectorOperators_fwd.hpp:68
dim
@ dim
Number of elements of this matrix.
Definition: MatrixBaseAddons.hpp:14
mm::ImplicitVectorOperators::ValueOp
Class representing the "evaluate" operation, i.e. the zero-th derivative.
Definition: ImplicitVectorOperators_fwd.hpp:178
mm::ImplicitVectorOperators::VecOpBase::operator*
RowVecOp operator*(scalar_t alpha)
Multiply this operation by a scalar.
Definition: ImplicitVectorOperators_fwd.hpp:153
mm::ImplicitVectorOperators::TractionOp::eval
RowVecOp eval(scalar_t alpha) const
Evaluate this operator.
Definition: ImplicitVectorOperators_fwd.hpp:279
mm::ImplicitVectorOperators::traction
TractionOp traction(int node, scalar_t lam, scalar_t mu, const domain_vector_t &unit_normal, int row)
Sets traction boundary conditions in node node.
Definition: ImplicitVectorOperators_fwd.hpp:532
mm::ImplicitVectorOperators::neumann
GradOp neumann(int node, const domain_vector_t &n)
Same as neumann with row equal to current node.
Definition: ImplicitVectorOperators_fwd.hpp:511
mm::ImplicitVectorOperators::BasicOp::BasicOp
BasicOp(ImplicitVectorOperators &op, int node, int row, typename op_family_t::operator_t o)
Construct given basic operator 'o'.
Definition: ImplicitVectorOperators_fwd.hpp:197
mm::ImplicitVectorOperators::graddiv
GradDivOp graddiv(int node)
Same as graddiv with row equal to current node.
Definition: ImplicitVectorOperators_fwd.hpp:488
mm::ImplicitVectorOperators::operator<<
friend std::ostream & operator<<(std::ostream &os, const ImplicitVectorOperators< S, M, R > &op)
Output basic info about given operators.
Definition: ImplicitVectorOperators.hpp:43
assert_msg
#define assert_msg(cond,...)
Assert with better error reporting.
Definition: assert.hpp:75
mm::ImplicitVectorOperators::Equation::eq_ixd
int eq_ixd
Index of the equation.
Definition: ImplicitVectorOperators_fwd.hpp:296
mm::ImplicitVectorOperators::BasicOp
Class representing basic operators.
Definition: ImplicitVectorOperators_fwd.hpp:191
mm::ImplicitVectorOperators::VecOpBase::operator*
friend RowVecOp operator*(scalar_t alpha, const VecOpBase &op)
Multiply with scalar from the left.
Definition: ImplicitVectorOperators_fwd.hpp:162
mm::ImplicitVectorOperators::M
matrix_t * M
Pointer to problem matrix.
Definition: ImplicitVectorOperators_fwd.hpp:62
mm::ImplicitVectorOperators::dim
@ dim
Dimensionality of the domain.
Definition: ImplicitVectorOperators_fwd.hpp:55
mm::ImplicitVectorOperators::vector_t
Eigen::Matrix< scalar_t, dim, 1 > vector_t
Vector type.
Definition: ImplicitVectorOperators_fwd.hpp:57
mm::ImplicitVectorOperators::GradOp
Class representing the directional derivative (gradient) operation.
Definition: ImplicitVectorOperators_fwd.hpp:217
mm::ImplicitVectorOperators::addToRhs
void addToRhs(int i, const vector_t &v)
Adds components of v to i, i+N, ..., i+(dim-1)*N-th rows of rhs.
Definition: ImplicitVectorOperators_fwd.hpp:74
mm::ImplicitVectorOperators::TractionOp::mu
scalar_t mu
2nd Lame constant.
Definition: ImplicitVectorOperators_fwd.hpp:270
mm::ImplicitVectorOperators::TractionOp::normal
domain_vector_t normal
Unit normal to the surface where traction os desired.
Definition: ImplicitVectorOperators_fwd.hpp:271
Config.hpp
mm::ImplicitVectorOperators::TractionOp::TractionOp
TractionOp(ImplicitVectorOperators &op, int node, int row, scalar_t lam, scalar_t mu, const domain_vector_t &normal)
Create traction operator with given Lame constants and outside unit normal.
Definition: ImplicitVectorOperators_fwd.hpp:274
USE_VECTOR_BASE
#define USE_VECTOR_BASE(Name)
Macro that inherits appropriate members from parent VecOpBase class.
Definition: ImplicitVectorOperators_fwd.hpp:166
mm::ImplicitVectorOperators::GradOp::vec
domain_vector_t vec
Vector representing the direction of differentiation.
Definition: ImplicitVectorOperators_fwd.hpp:220
mm::ImplicitVectorOperators::RowVecOp::operator=
void operator=(const vector_t &value)
Assigns given value to the right hand side.
Definition: ImplicitVectorOperators_fwd.hpp:118
mm::ImplicitVectorOperators::grad
GradOp grad(int node, const domain_vector_t &v)
Same as grad with row equal to current node.
Definition: ImplicitVectorOperators_fwd.hpp:467
mm::ImplicitVectorOperators::setProblem
void setProblem(matrix_t &M, rhs_t &rhs, int row_offset=0, int col_offset=0)
Sets current matrix and right hand side.
Definition: ImplicitVectorOperators_fwd.hpp:343
mm::ImplicitVectorOperators::VecOpBase::operator+
RowVecOp operator+(const VecOpBase< other_derived_t > &right)
Combine tho operation with another operation. Both operations are evaluated.
Definition: ImplicitVectorOperators_fwd.hpp:160
mm::ImplicitVectorOperators::eq
Equation eq(int num)
Choose one specific component of the vector equation to write to.
Definition: ImplicitVectorOperators_fwd.hpp:374
mm::ImplicitVectorOperators::hasShapes
bool hasShapes() const
Returns true if operators have a non-null pointer to storage and false otherwise.
Definition: ImplicitVectorOperators_fwd.hpp:361
mm::ImplicitOperators
This class represents implicit operators that fill given matrix M and right hand side rhs with approp...
Definition: ImplicitOperators_fwd.hpp:40
mm::ImplicitVectorOperators::graddiv
GradDivOp graddiv(int node, int row)
Sets implicit equation that gradient of divergence of a vector field is equal to some other value.
Definition: ImplicitVectorOperators_fwd.hpp:486
assert.hpp
mm::ImplicitVectorOperators::VecOpBase::row
int row
Matrix row to which the operation should be applied (without offset).
Definition: ImplicitVectorOperators_fwd.hpp:135
mm::ImplicitVectorOperators::VecOpBase::operator=
void operator=(const vector_t &x)
Evaluates *this and sets rhs to x.
Definition: ImplicitVectorOperators_fwd.hpp:151
mm::ImplicitVectorOperators::GradDivOp
Class representing the gradient of the divergence operator, i.e. operator .
Definition: ImplicitVectorOperators_fwd.hpp:245
mm::ImplicitVectorOperators::ss
const shape_storage_t * ss
Shape storage, but name is shortened for readability.
Definition: ImplicitVectorOperators_fwd.hpp:61
mm::ImplicitVectorOperators::RowVecOp::RowVecOp
RowVecOp(ImplicitVectorOperators &op, int row)
Construct a row operation for a given row.
Definition: ImplicitVectorOperators_fwd.hpp:98
mm::ImplicitVectorOperators::domain_vector_t
shape_storage_t::vector_t domain_vector_t
Vector type for vectors in the domain, usually float or double.
Definition: ImplicitVectorOperators_fwd.hpp:50
mm::ImplicitVectorOperators::col_offset
int col_offset
Column offset to be used when accessing matrix coefficients.
Definition: ImplicitVectorOperators_fwd.hpp:65
mm::ImplicitVectorOperators::GradOp::GradOp
GradOp(ImplicitVectorOperators &op, int node, int row, const domain_vector_t &vec)
Construct directional derivative operator with given direction.
Definition: ImplicitVectorOperators_fwd.hpp:222
mm::ImplicitVectorOperators::scalar_t
matrix_t::Scalar scalar_t
Scalar type of matrix elements.
Definition: ImplicitVectorOperators_fwd.hpp:53
mm::ImplicitVectorOperators::GradOp::eval
RowVecOp eval(scalar_t alpha) const
Evaluate this operator.
Definition: ImplicitVectorOperators_fwd.hpp:226
mm::ImplicitVectorOperators::VecOpBase::operator-
RowVecOp operator-()
Multiply this operation by -1.
Definition: ImplicitVectorOperators_fwd.hpp:157
ImplicitOperators_fwd.hpp
mm::ImplicitVectorOperators::VecOpBase
Base class for all elementary implicit vector operations.
Definition: ImplicitVectorOperators_fwd.hpp:82
mm::ImplicitVectorOperators::RowVecOp::row_
int row_
Index of the row to which this operation refers.
Definition: ImplicitVectorOperators_fwd.hpp:96
mm::ImplicitVectorOperators::VecOpBase::VecOpBase
VecOpBase(ImplicitVectorOperators &op, int node, int row)
Construct operation for a given node.
Definition: ImplicitVectorOperators_fwd.hpp:137
mm::ImplicitVectorOperators::apply
BasicOp< op_family_t > apply(int node, typename op_family_t::operator_t o, int row)
Add the weights for operator o to the appropriate elements in the matrix.
Definition: ImplicitVectorOperators_fwd.hpp:433
mm::ImplicitVectorOperators::RowVecOp::op
ImplicitVectorOperators & op
Reference to underlying operators.
Definition: ImplicitVectorOperators_fwd.hpp:95
mm::ImplicitVectorOperators::Equation::c
ImplicitOperators< shape_storage_t, matrix_t, rhs_t > c(int comp)
Returns ordinary ImplicitOperators for component comp of equation eq_idx.
Definition: ImplicitVectorOperators_fwd.hpp:307
mm::ImplicitVectorOperators::lap
BasicOp< Lap< dim > > lap(int node)
Same as lap with row equal to current node.
Definition: ImplicitVectorOperators_fwd.hpp:422
mm::ImplicitVectorOperators::shape_storage_t
shape_storage_type shape_storage_t
Type of shape storage.
Definition: ImplicitVectorOperators_fwd.hpp:46
mm::ImplicitVectorOperators::VecOpBase::op
ImplicitVectorOperators & op
Reference to underlying operators.
Definition: ImplicitVectorOperators_fwd.hpp:133
mm::ImplicitVectorOperators::TractionOp::lam
scalar_t lam
1st Lame constant.
Definition: ImplicitVectorOperators_fwd.hpp:269
mm::ImplicitVectorOperators::ImplicitVectorOperators
ImplicitVectorOperators()
Default constructor sets offset to 0 and pointers to nullptr.
Definition: ImplicitVectorOperators_fwd.hpp:319
mm::ImplicitVectorOperators::BasicOp::o
op_family_t::operator_t o
Basic operator with precomputed shape functions.
Definition: ImplicitVectorOperators_fwd.hpp:194
mm::ImplicitVectorOperators
This class represents implicit vector operators that fill given matrix M and right hand side rhs with...
Definition: ImplicitVectorOperators_fwd.hpp:44
mm::ImplicitVectorOperators::apply
BasicOp< op_family_t > apply(int node)
Overload for default-constructible operator.
Definition: ImplicitVectorOperators_fwd.hpp:445
mm::ImplicitVectorOperators::RowVecOp::operator+
RowVecOp operator+(const VecOpBase< derived_t > &right)
Add normal operation to a row operation by evaluating the former and adding normally.
Definition: ImplicitVectorOperators_fwd.hpp:116
mm::ImplicitVectorOperators::TractionOp
Class representing the traction operator. Useful for setting boundary conditions.
Definition: ImplicitVectorOperators_fwd.hpp:266
mm::ImplicitVectorOperators::row_offset
int row_offset
Row offset to be used when accessing matrix or rhs coefficients.
Definition: ImplicitVectorOperators_fwd.hpp:64
mm::ImplicitVectorOperators::VecOpBase::eval
RowVecOp eval() const
Eval with alpha = 1.0.
Definition: ImplicitVectorOperators_fwd.hpp:149
mm::ImplicitVectorOperators::VecOpBase::node
int node
Index of the point for which to apply the operation.
Definition: ImplicitVectorOperators_fwd.hpp:134
mm::ImplicitVectorOperators::Equation
Represents one scalar component of a vector equation.
Definition: ImplicitVectorOperators_fwd.hpp:294
mm::ImplicitVectorOperators::lap
BasicOp< Lap< dim > > lap(int node, int row)
Sets implicit equation that Laplacian of a vector field is equal to some other value.
Definition: ImplicitVectorOperators_fwd.hpp:420
mm::ImplicitVectorOperators::value
ValueOp value(int node)
Same as value with row equal to current node.
Definition: ImplicitVectorOperators_fwd.hpp:398
mm::ImplicitVectorOperators::setColOffset
void setColOffset(int col_offset)
Sets col offset for given matrix, treating it as is the first column had index col_offset.
Definition: ImplicitVectorOperators_fwd.hpp:355
mm::ImplicitVectorOperators::RowVecOp
Class representing an operation on a specific set of rows of the matrix.
Definition: ImplicitVectorOperators_fwd.hpp:92