My Project
asmhandler.hpp
Go to the documentation of this file.
1//==============================================================================
11//==============================================================================
12#ifndef ASMHANDLER_HPP_
13#define ASMHANDLER_HPP_
14
15#include <opm/common/utility/platform_dependent/disable_warnings.h>
16
17#include <dune/geometry/referenceelements.hh>
18#include <dune/common/fmatrix.hh>
19#include <dune/istl/bvector.hh>
20#include <dune/common/fvector.hh>
21
22#include <opm/common/utility/platform_dependent/reenable_warnings.h>
23
24
26#include <opm/elasticity/mpc.hh>
28
29namespace Opm {
30namespace Elasticity {
31
32
34 template<class GridType>
36 public:
38 static const int dim = GridType::dimension;
39
41 typedef typename GridType::LeafGridView::IndexSet LeafIndexSet;
42
44 typedef typename GridType::LeafGridView::template Codim<0>::Iterator LeafIterator;
45
48 ASMHandler(const GridType& gv_) : gv(gv_), maxeqn(0)
49 {
50 }
51
54 {
55 for (MPCMap::iterator it=mpcs.begin(); it != mpcs.end();++it)
56 delete it->second;
57 }
58
60 typedef Dune::FieldVector<double,dim> NodeValue;
61
64 size_t getEqns() const
65 {
66 return maxeqn;
67 }
68
73 int getEquationForDof(int node, int dof)
74 {
75 return meqn[node*dim+dof];
76 }
77
81 {
82 return A;
83 }
84
88 {
89 return b;
90 }
91
94 void initForAssembly();
95
102 template<int esize>
103 void addElement(const Dune::FieldMatrix<double,esize,esize>* K,
104 const Dune::FieldVector<double,esize>* S,
105 const LeafIterator& cell,
106 Vector* b=NULL);
107
112 template<int comp>
113 void extractValues(Dune::FieldVector<double,comp>& v,
114 const Vector& u, const LeafIterator& it);
115
117 void expandSolution(Vector& result, const Vector& u);
118
122 void addMPC(MPC* mpc);
123
128 MPC* getMPC(int node, int dof);
129
133 void updateFixedNode(int node,
134 const std::pair<Direction,NodeValue>& entry);
135
138 bool isFixed(int node)
139 {
140 return (fixedNodes.find(node) != fixedNodes.end());
141 }
142
144 void printOperator() const;
145
147 void printLoadVector() const;
148
152 {
153 return adjacencyPattern;
154 }
155 protected:
158 {
159 for (MPCMap::iterator it = mpcs.begin();
160 it != mpcs.end();++it)
161 resolveMPCChain(it->second);
162 }
163
166 void resolveMPCChain(MPC* mpc);
167
1