Skip to content
Snippets Groups Projects
Commit 67b2b386 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Get rid of dataref

parent 14a40c3a
No related branches found
No related tags found
No related merge requests found
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
namespace Dune { namespace Dune {
template <class MatrixTypeTEMPLATE, class VectorTypeTEMPLATE> template <class MatrixTypeTEMPLATE, class VectorTypeTEMPLATE>
class GlobalNonlinearity { class GlobalNonlinearity {
private: protected:
using dataref = BlockVector<FieldVector<double, 1>> const &; using SingletonVectorType = BlockVector<FieldVector<double, 1>>;
public: public:
using MatrixType = MatrixTypeTEMPLATE; using MatrixType = MatrixTypeTEMPLATE;
...@@ -78,7 +78,7 @@ class GlobalNonlinearity { ...@@ -78,7 +78,7 @@ class GlobalNonlinearity {
return res->regularity(x); return res->regularity(x);
} }
virtual void updateState(dataref state) = 0; virtual void updateState(SingletonVectorType const &state) = 0;
}; };
} }
#endif #endif
...@@ -18,13 +18,15 @@ template <class MatrixType, class VectorType> ...@@ -18,13 +18,15 @@ template <class MatrixType, class VectorType>
class GlobalRuinaNonlinearity class GlobalRuinaNonlinearity
: public GlobalNonlinearity<MatrixType, VectorType> { : public GlobalNonlinearity<MatrixType, VectorType> {
private: private:
using dataref = BlockVector<FieldVector<double, 1>> const &; using typename GlobalNonlinearity<MatrixType,
VectorType>::SingletonVectorType;
public: public:
using GlobalNonlinearity<MatrixType, VectorType>::dim; using GlobalNonlinearity<MatrixType, VectorType>::dim;
GlobalRuinaNonlinearity(Dune::BitSetVector<1> const &frictionalNodes, GlobalRuinaNonlinearity(Dune::BitSetVector<1> const &frictionalNodes,
dataref nodalIntegrals, FrictionData const &fd) SingletonVectorType const &nodalIntegrals,
FrictionData const &fd)
: restrictions(nodalIntegrals.size()) { : restrictions(nodalIntegrals.size()) {
auto trivialNonlinearity = auto trivialNonlinearity =
make_shared<LocalFriction<dim>>(make_shared<TrivialFunction>()); make_shared<LocalFriction<dim>>(make_shared<TrivialFunction>());
...@@ -37,7 +39,7 @@ class GlobalRuinaNonlinearity ...@@ -37,7 +39,7 @@ class GlobalRuinaNonlinearity
} }
} }
void updateState(dataref state) override { void updateState(SingletonVectorType const &state) override {
for (size_t i = 0; i < restrictions.size(); ++i) for (size_t i = 0; i < restrictions.size(); ++i)
restrictions[i]->updateState(state[i]); restrictions[i]->updateState(state[i]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment