My Project
mortar_utils.hpp
Go to the documentation of this file.
1//==============================================================================
11//==============================================================================
12#ifndef MORTAR_UTILS_HPP_
13#define MORTAR_UTILS_HPP_
14
15namespace Opm {
16 namespace Elasticity {
17
19 public:
25 static void extractBlock(Vector& x, const Vector& y, int len, int start=0)
26 {
27#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
28 x.resize(len);
29#else
30 x.resize(len,false);
31#endif
32 std::copy(y.begin()+start,y.begin()+len+start,x.begin());
33 }
34
40 static void injectBlock(Vector& x, const Vector& y, int len, int start=0)
41 {
42 std::copy(y.begin(),y.begin()+len,x.begin()+start);
43 }
44};
45
46}
47}
48
49#endif
Definition: mortar_utils.hpp:18
static void extractBlock(Vector &x, const Vector &y, int len, int start=0)
Extract a range of indices from a vector.
Definition: mortar_utils.hpp:25
static void injectBlock(Vector &x, const Vector &y, int len, int start=0)
Inject a range of indices into a vector.
Definition: mortar_utils.hpp:40
Dune::BlockVector< Dune::FieldVector< double, 1 > > Vector
A vector holding our RHS.
Definition: matrixops.hpp:33
Inverting small matrices.
Definition: ImplicitAssembly.hpp:43