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
No related branches found
No related tags found
No related merge requests found
......@@ -33,10 +33,10 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol,
for (; it!=endIt; ++it) {
// A 1d grid has two vertices
const int nDofs = 2;
static const int nDofs = 2;
// Extract local solution
std::vector<RigidBodyMotion<3> > localSolution(nDofs);
Dune::array<RigidBodyMotion<3>, nDofs> localSolution;
for (int i=0; i<nDofs; i++)
localSolution[i] = sol[indexSet.subIndex(*it,i,gridDim)];
......
......@@ -96,7 +96,7 @@ public:
}
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 */
void assembleGradient(const Entity& element,
......@@ -142,7 +142,7 @@ protected:
template <class GridType, class RT>
RT RodLocalStiffness<GridType, RT>::
energy(const Entity& element,
const std::vector<RigidBodyMotion<3> >& localSolution
const Dune::array<RigidBodyMotion<3>, dim+1>& localSolution
) const
{
RT energy = 0;
......@@ -159,6 +159,9 @@ energy(const Entity& element,
const Dune::QuadratureRule<double, 1>& shearingQuad
= 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++) {
// Local position of the quadrature point
......@@ -168,7 +171,7 @@ energy(const Entity& element,
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
Dune::FieldVector<double,6> referenceStrain = getStrain(localReferenceConfiguration, element, quadPos);
......@@ -189,7 +192,7 @@ energy(const Entity& element,
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
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.
Finish editing this message first!
Please register or to comment