Commit fb75b6de authored by akbib's avatar akbib Committed by akbib@FU-BERLIN.DE
Browse files

store a pointer to the global basis instead of a reference

[[Imported from SVN: r11185]]
parent d9d1aa24
......@@ -49,7 +49,7 @@ public:
nu_(nu)
{}
void setup(ctype E, ctype nu)
void setup(ctype E, ctype nu, const Basis& basis)
{
E_ = E;
nu_ = nu;
......@@ -60,7 +60,8 @@ public:
localLinearization_ = Dune::shared_ptr<LocalLinearization>(new LocalLinearization(E,nu));
localHessian_ = Dune::shared_ptr<LocalHessian>(new LocalHessian(E,nu));
basis_ = &basis;
}
//! Evaluate the strain energy
......@@ -68,7 +69,7 @@ public:
ctype energy(const CoeffType& coeff)
{
// make grid function
BasisGridFunction<Basis,CoeffType> configuration(basis_,coeff);
BasisGridFunction<Basis,CoeffType> configuration(*basis_,coeff);
ctype energy=0;
const GridType& grid = configuration.grid();
......@@ -79,7 +80,7 @@ public:
for (;eIt != eItEnd; ++eIt) {
// get quadrature rule
QuadratureRuleKey quad1(basis_.getLocalFiniteElement(*eIt));
QuadratureRuleKey quad1(basis_->getLocalFiniteElement(*eIt));
QuadratureRuleKey quadKey = quad1.derivative().square().square();
const Dune::template QuadratureRule<ctype, dim>& quad = QuadratureRuleCache<ctype, dim>::rule(quadKey);
......@@ -124,7 +125,7 @@ public:
LocalHessian& secondDerivative() {return *localHessian_;}
//! Return the global basis
const Basis& basis() {return basis_;}
const Basis& basis() {return *basis_;}
private:
//! First derivative of the strain energy
......@@ -134,7 +135,7 @@ private:
Dune::shared_ptr<LocalHessian> localHessian_;
//! Global basis used for the spatial discretization
const Basis& basis_;
const Basis* basis_;
//! Elasticity modulus
ctype E_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment