Skip to content
Snippets Groups Projects
matrices.hh 855 B
Newer Older
#ifndef SRC_MATRICES_HH
#define SRC_MATRICES_HH

template <class Matrix, size_t n>
class Matrices {
podlesny's avatar
.  
podlesny committed
public:
  std::vector<std::shared_ptr<Matrix>> elasticity;
  std::vector<std::shared_ptr<Matrix>> damping;
  std::vector<std::shared_ptr<Matrix>> mass;

podlesny's avatar
.  
podlesny committed
    elasticity.resize(n);
    damping.resize(n);
    mass.resize(n);

      for (size_t i=0; i<n; i++) {
        elasticity[i] = std::make_shared<Matrix>();
        damping[i] = std::make_shared<Matrix>();
        mass[i] = std::make_shared<Matrix>();
      }
podlesny's avatar
.  
podlesny committed
  }

template <class Matrix> 
class Matrices<Matrix, 1> {
public:
  std::shared_ptr<Matrix> elasticity;
  std::shared_ptr<Matrix> damping;
  std::shared_ptr<Matrix> mass;

  Matrices() :
    elasticity(std::make_shared<Matrix>()),
    damping(std::make_shared<Matrix>()),
    mass(std::make_shared<Matrix>())
  {}
};