Skip to content
Snippets Groups Projects
Commit 5affcea4 authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

change std::vector to Dune::array to adapt to changes in the local assembler base class

[[Imported from SVN: r7574]]
parent 867bb84c
Branches
No related tags found
No related merge requests found
...@@ -33,10 +33,10 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol, ...@@ -33,10 +33,10 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol,
for (; it!=endIt; ++it) { for (; it!=endIt; ++it) {
// A 1d grid has two vertices // A 1d grid has two vertices
const int nDofs = 2; static const int nDofs = 2;
// Extract local solution // Extract local solution
std::vector<RigidBodyMotion<3> > localSolution(nDofs); Dune::array<RigidBodyMotion<3>, nDofs> localSolution;
for (int i=0; i<nDofs; i++) for (int i=0; i<nDofs; i++)
localSolution[i] = sol[indexSet.subIndex(*it,i,gridDim)]; localSolution[i] = sol[indexSet.subIndex(*it,i,gridDim)];
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
} }
virtual RT energy (const Entity& e, virtual RT energy (const Entity& e,
const std::vector<RigidBodyMotion<3> >& localSolution) const; const Dune::array<RigidBodyMotion<3>, dim+1>& localSolution) const;
/** \brief Assemble the element gradient of the energy functional */ /** \brief Assemble the element gradient of the energy functional */
void assembleGradient(const Entity& element, void assembleGradient(const Entity& element,
...@@ -142,7 +142,7 @@ protected: ...@@ -142,7 +142,7 @@ protected:
template <class GridType, class RT> template <class GridType, class RT>
RT RodLocalStiffness<GridType, RT>:: RT RodLocalStiffness<GridType, RT>::
energy(const Entity& element, energy(const Entity& element,
const std::vector<RigidBodyMotion<3> >& localSolution const Dune::array<RigidBodyMotion<3>, dim+1>& localSolution
) const ) const
{ {
RT energy = 0; RT energy = 0;
...@@ -159,6 +159,9 @@ energy(const Entity& element, ...@@ -159,6 +159,9 @@ energy(const Entity& element,
const Dune::QuadratureRule<double, 1>& shearingQuad const Dune::QuadratureRule<double, 1>& shearingQuad
= Dune::QuadratureRules<double, 1>::rule(element.type(), shearQuadOrder); = Dune::QuadratureRules<double, 1>::rule(element.type(), shearQuadOrder);
// hack: convert from std::array to std::vector
std::vector<RigidBodyMotion<3> > localSolutionVector(localSolution.begin(), localSolution.end());
for (size_t pt=0; pt<shearingQuad.size(); pt++) { for (size_t pt=0; pt<shearingQuad.size(); pt++) {
// Local position of the quadrature point // Local position of the quadrature point
...@@ -168,7 +171,7 @@ energy(const Entity& element, ...@@ -168,7 +171,7 @@ energy(const Entity& element,
double weight = shearingQuad[pt].weight() * integrationElement; double weight = shearingQuad[pt].weight() * integrationElement;
Dune::FieldVector<double,6> strain = getStrain(localSolution, element, quadPos); Dune::FieldVector<double,6> strain = getStrain(localSolutionVector, element, quadPos);
// The reference strain // The reference strain
Dune::FieldVector<double,6> referenceStrain = getStrain(localReferenceConfiguration, element, quadPos); Dune::FieldVector<double,6> referenceStrain = getStrain(localReferenceConfiguration, element, quadPos);
...@@ -189,7 +192,7 @@ energy(const Entity& element, ...@@ -189,7 +192,7 @@ energy(const Entity& element,
double weight = bendingQuad[pt].weight() * element.geometry().integrationElement(quadPos); double weight = bendingQuad[pt].weight() * element.geometry().integrationElement(quadPos);
Dune::FieldVector<double,6> strain = getStrain(localSolution, element, quadPos); Dune::FieldVector<double,6> strain = getStrain(localSolutionVector, element, quadPos);
// The reference strain // The reference strain
Dune::FieldVector<double,6> referenceStrain = getStrain(localReferenceConfiguration, element, quadPos); Dune::FieldVector<double,6> referenceStrain = getStrain(localReferenceConfiguration, element, quadPos);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment