Skip to content

Commit

Permalink
Additional accessors
Browse files Browse the repository at this point in the history
Providing something with an explicit return value rather than a
return-in-argument style should make app compatibility conversions
easier.
  • Loading branch information
roystgnr committed Sep 9, 2013
1 parent a235157 commit 89903c7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions include/systems/fem_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,33 @@ class FEMContext : public DiffContext
template<typename OutputShape>
void get_element_fe( unsigned int var, FEGenericBase<OutputShape> *& fe ) const;

/**
* Accessor for interior finite element object for scalar-valued variable var.
*/
FEBase* get_element_fe( unsigned int var ) const;

/**
* Accessor for edge/face (2D/3D) finite element object for variable var.
*/
template<typename OutputShape>
void get_side_fe( unsigned int var, FEGenericBase<OutputShape> *& fe ) const;

/**
* Accessor for side finite element object for scalar-valued variable var.
*/
FEBase* get_side_fe( unsigned int var ) const;

/**
* Accessor for edge (3D only!) finite element object for variable var.
*/
template<typename OutputShape>
void get_edge_fe( unsigned int var, FEGenericBase<OutputShape> *& fe ) const;

/**
* Accessor for edge finite element object for scalar-valued variable var.
*/
FEBase* get_edge_fe( unsigned int var ) const;

/**
* Returns the value of the solution variable \p var at the quadrature
* point \p qp on the current element interior. This is the preferred API.
Expand Down Expand Up @@ -770,6 +785,13 @@ void FEMContext::get_element_fe( unsigned int var, FEGenericBase<OutputShape> *&
fe = libmesh_cast_ptr<FEGenericBase<OutputShape>*>( _element_fe_var[var] );
}

inline
FEBase* FEMContext::get_element_fe( unsigned int var ) const
{
libmesh_assert_less ( var, _element_fe_var.size() );
return libmesh_cast_ptr<FEBase*>( _element_fe_var[var] );
}

template<typename OutputShape>
inline
void FEMContext::get_side_fe( unsigned int var, FEGenericBase<OutputShape> *& fe ) const
Expand All @@ -778,6 +800,13 @@ void FEMContext::get_side_fe( unsigned int var, FEGenericBase<OutputShape> *& fe
fe = libmesh_cast_ptr<FEGenericBase<OutputShape>*>( _side_fe_var[var] );
}

inline
FEBase* FEMContext::get_side_fe( unsigned int var ) const
{
libmesh_assert_less ( var, _side_fe_var.size() );
return libmesh_cast_ptr<FEBase*>( _side_fe_var[var] );
}

template<typename OutputShape>
inline
void FEMContext::get_edge_fe( unsigned int var, FEGenericBase<OutputShape> *& fe ) const
Expand All @@ -786,6 +815,13 @@ void FEMContext::get_edge_fe( unsigned int var, FEGenericBase<OutputShape> *& fe
fe = libmesh_cast_ptr<FEGenericBase<OutputShape>*>( _edge_fe_var[var] );
}

inline
FEBase* FEMContext::get_edge_fe( unsigned int var ) const
{
libmesh_assert_less ( var, _edge_fe_var.size() );
return libmesh_cast_ptr<FEBase*>( _edge_fe_var[var] );
}


} // namespace libMesh

Expand Down

0 comments on commit 89903c7

Please sign in to comment.