DenseVector<_Type> TwoD_Mapped_Node_Mesh<_Type>::get_nodes_vars(const std::size_t nodex, const std::size_t nodey) const {
#ifdef PARANOID
    if(nodex > m_nx - 1 || nodey > m_ny - 1) {
      std::string problem;
      problem = " The TwoD_Mapped_Node_Mesh.get_nodes_vars method is trying to \n";
      problem += " access a nodal point that is not in the mesh. \n";
      throw ExceptionRange(problem, m_nx, nodex, m_ny, nodey);
    }
#endif
    // construct a vector with m_nv elements starting from a pointer
    DenseVector<_Type> nodes_vars(m_nv, &m_vars[(nodex * m_ny + nodey) * m_nv ]);
    return nodes_vars;
  }
Example #2
0
  DenseVector<_Type> OneD_Node_Mesh<_Type, _Xtype>::get_nodes_vars( const std::size_t &node ) const
  {
#ifdef PARANOID
    if ( ( node >= X.size() ) || ( node < 0 ) )
    {
      std::string problem;
      problem = " The OneD_Node_Mesh.get_nodes_vars method is trying to access \n";
      problem += " a nodal point outside of the range stored. \n";
      throw ExceptionRange( problem, X.size(), node );
    }
#endif
    DenseVector<_Type> nodes_vars;
    for ( std::size_t var = 0; var < NV; ++var )
    {
      nodes_vars.push_back( VARS[ node * NV + var ] );
    }
    return nodes_vars;
  }