Loading...
Searching...
No Matches
test_component.h
Go to the documentation of this file.
#ifndef _RHEOLEF_TEST_COMPONENT_H
#define _RHEOLEF_TEST_COMPONENT_H
// test[i] : indexation for test and trial functions
//
#include "rheolef/test.h"
namespace rheolef { namespace details {
// =========================================================================
// test_component
// =========================================================================
template <class T, class M, class VfTag>
class test_component_rep {
public:
// typename:
typedef test_basic<T,M,VfTag> test_type;
typedef typename test_type::size_type size_type;
typedef typename test_type::value_type value_type;
typedef M memory_type;
typedef typename test_type::scalar_type scalar_type;
typedef typename test_type::float_type float_type;
typedef details::differentiate_option::type diff_type;
typedef space_basic<float_type,M> space_type;
// allocators:
test_component_rep (const test_basic<T,M,VfTag>& u, size_type i_comp);
test_component_rep (const test_component<T,M,VfTag>& u, size_type i_comp);
test_component_rep (const test_component_rep<T,M,VfTag>&);
test_component_rep<T,M,VfTag>& operator= (const test_component_rep<T,M,VfTag>&);
// accessors:
const space_type& get_vf_space() const { return _u.get_vf_space(); }
static const space_constant::valued_type valued_hint = space_constant::last_valued;
space_constant::valued_type valued_tag() const { return _u_comp.get_vf_space().valued_tag(); }
// initializers:
void initialize (
const piola_on_pointset<T>& pops,
const integrate_option& iopt)
{ _u_comp.initialize (pops, iopt); }
void initialize (
const band_basic<float_type,memory_type>& gh,
const piola_on_pointset<T>& pops,
const integrate_option& iopt)
{ _u_comp.initialize (gh, pops, iopt); _is_on_band = true; }
void initialize (
const space_basic<float_type,memory_type>& Xh,
const integrate_option& iopt)
{ _u_comp.initialize (Xh, iopt); }
// evaluators:
template<class Value, details::differentiate_option::type Diff>
void evaluate (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const details::differentiate_option& gopt,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const;
template<class Value, details::differentiate_option::type Diff>
void evaluate_on_side (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const side_information_type& sid,
const details::differentiate_option& gopt,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value,
bool do_local_component_assembly) const;
template<class Value>
void local_dg_merge_on_side (
const geo_basic<T,M>& omega_K,
const geo_element& S,
const geo_element& K0,
const geo_element& K1,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value0,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value1,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const;
// checks:
template<class ValueType>
void valued_check() const {
space_constant::valued_type valued_tag = space_constant::valued_tag_traits<ValueType>::value;
check_macro (_u_comp.valued_tag() == valued_tag, "unexpected "<<_u_comp.get_vf_space().valued()
<< "-valued field while a " << space_constant::valued_name(valued_tag)
<< "-valued one is expected in expression");
}
template<class ValueType>
void grad_valued_check() const {
typedef typename space_constant::rank_down<ValueType>::type A1;
space_constant::valued_type arg_valued_tag = space_constant::valued_tag_traits<A1>::value;
check_macro (_u_comp.valued_tag() == arg_valued_tag, "grad(): unexpected "<<_u_comp.get_vf_space().valued()
<< "-valued field while a " << space_constant::valued_name(arg_valued_tag)
<< "-valued one is expected in expression");
}
template<class ValueType>
void div_valued_check() const {
typedef typename space_constant::rank_up<ValueType>::type A1;
space_constant::valued_type arg_valued_tag = space_constant::valued_tag_traits<A1>::value;
check_macro (_u_comp.valued_tag() == arg_valued_tag, "div(): unexpected "<<_u_comp.get_vf_space().valued()
<< "-valued field while a " << space_constant::valued_name(arg_valued_tag)
<< "-valued one is expected in expression");
}
protected:
// internals:
static space_type _init_space_comp(const space_type& Xh, size_type i_comp);
void _initialize_numbering (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K) const;
template<class Value>
void _evaluate_continued (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value_comp,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const;
template<class Value>
void _evaluate_on_side_continued (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const side_information_type& sid,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value_comp,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const;
// data:
size_type _i_comp;
test_basic<T,M,VfTag> _u, _u_comp; // top-level and curent-level test-function u[i0][i1]...[iN]
const test_component_rep<T,M,VfTag>& get_u_comp_upper_data() const { return *_ptr_u_comp_upper_data; }
bool _has_subcomponent() const { return _ptr_u_comp_upper_data.operator->() != 0; }
smart_pointer<test_component_rep<T,M,VfTag>> _ptr_u_comp_upper_data;
// upper-level test-function u[i0]...[i(N-1)] when N>1
// note: clang++ cannot manage directly test_component<..> that has incomplete type
// but g++ can, so fall back to smart_pointer for clang++...
mutable std::array<size_type,reference_element::max_variant> // lazy initialization, on the fly
_loc_ndof,
_first_loc_idof,
_last_loc_idof;
mutable bool _is_on_band;
};
// -------------------------------------------------------------------------
// inlined
// -------------------------------------------------------------------------
template <class T, class M, class VfTag>
test_component_rep<T,M,VfTag>::test_component_rep (const test_component_rep<T,M,VfTag>& x)
: _i_comp (x._i_comp),
_u (x._u),
_u_comp (x._u_comp),
_ptr_u_comp_upper_data (x._ptr_u_comp_upper_data),
_loc_ndof (x._loc_ndof),
_first_loc_idof (x._first_loc_idof),
_last_loc_idof (x._last_loc_idof),
_is_on_band (x._is_on_band)
{
trace_macro ("** PHYSICAL COPY OF TEST_COMPONENT **");
}
template <class T, class M, class VfTag>
test_component_rep<T,M,VfTag>&
test_component_rep<T,M,VfTag>::operator= (const test_component_rep<T,M,VfTag>& x)
{
trace_macro ("** PHYSICAL ASSIGN OF TEST_COMPONENT **");
_i_comp = x._i_comp;
_u = x._u;
_u_comp = x._u_comp;
_ptr_u_comp_upper_data = x._ptr_u_comp_upper_data;
_loc_ndof = x._loc_ndof;
_first_loc_idof = x._first_loc_idof;
_last_loc_idof = x._last_loc_idof;
_is_on_band = x._is_on_band;
return *this;
}
template <class T, class M, class VfTag>
test_component_rep<T,M,VfTag>::test_component_rep (const test_basic<T,M,VfTag>& u, size_type i_comp)
: _i_comp(i_comp),
_u(u),
_u_comp (_init_space_comp(u.get_vf_space(),i_comp)),
_ptr_u_comp_upper_data(),
_loc_ndof(),
_first_loc_idof(),
_last_loc_idof(),
_is_on_band(false)
{
_first_loc_idof.fill (std::numeric_limits<size_type>::max());
}
template <class T, class M, class VfTag>
test_component_rep<T,M,VfTag>::test_component_rep (const test_component<T,M,VfTag>& u_comp_upper, size_type i_subcomp)
: _i_comp(i_subcomp),
_u(u_comp_upper.data()._u),
_u_comp (_init_space_comp(u_comp_upper.data()._u_comp.get_vf_space(),i_subcomp)),
_ptr_u_comp_upper_data(u_comp_upper),
_loc_ndof(),
_first_loc_idof(),
_last_loc_idof(),
_is_on_band(false)
{
_first_loc_idof.fill (std::numeric_limits<size_type>::max());
}
template <class T, class M, class VfTag>
typename test_component_rep<T,M,VfTag>::space_type
test_component_rep<T,M,VfTag>::_init_space_comp (const space_type& Xh, size_type i_comp)
{
check_macro (i_comp < Xh.size(), "test component index "<<i_comp<<" is out of range [0:"<<Xh.size()<<"[");
space_basic<T,M> Xh_comp = Xh[i_comp];
return Xh_comp;
}
template <class T, class M, class VfTag>
void
test_component_rep<T,M,VfTag>::_initialize_numbering (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K) const
{
size_type variant = K.variant();
if (_has_subcomponent()) {
const space_type& Xh_upper = get_u_comp_upper_data()._u_comp.get_vf_space();
get_u_comp_upper_data()._initialize_numbering (omega_K, K); // recursive call
_loc_ndof[variant] = get_u_comp_upper_data()._loc_ndof [variant];
_first_loc_idof[variant] = get_u_comp_upper_data()._first_loc_idof[variant];
for (size_type j_comp = 0; j_comp < _i_comp; ++j_comp) {
size_type loc_jcomp_ndof = Xh_upper.get_constitution()[j_comp].assembly_loc_ndof (omega_K, K);
_first_loc_idof[variant] += loc_jcomp_ndof;
}
size_type loc_icomp_ndof = Xh_upper.get_constitution()[_i_comp].assembly_loc_ndof (omega_K, K);
_last_loc_idof[variant] = _first_loc_idof[variant] + loc_icomp_ndof;
} else {
const space_type& Xh_upper = _u.get_vf_space();
_loc_ndof[variant] = _u.get_vf_space().get_constitution().assembly_loc_ndof (omega_K, K);
_first_loc_idof[variant] = 0;
for (size_type j_comp = 0; j_comp < _i_comp; ++j_comp) {
size_type loc_jcomp_ndof = Xh_upper.get_constitution()[j_comp].assembly_loc_ndof (omega_K, K);
_first_loc_idof[variant] += loc_jcomp_ndof;
}
size_type loc_icomp_ndof = 0;
loc_icomp_ndof = Xh_upper.get_constitution()[_i_comp].assembly_loc_ndof (omega_K, K);
_last_loc_idof[variant] = _first_loc_idof[variant] + loc_icomp_ndof;
}
}
template <class T, class M, class VfTag>
template<class Value, details::differentiate_option::type Diff>
void
test_component_rep<T,M,VfTag>::evaluate (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const details::differentiate_option& gopt,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
{
// 1) evaluate the component: u[i_comp]:
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic> value_comp;
_u_comp.template evaluate<Value,Diff> (omega_K, K, gopt, value_comp);
// 2) copy value_comp[] into value[]
_evaluate_continued (omega_K, K, value_comp, value);
}
template <class T, class M, class VfTag>
template<class Value>
void
test_component_rep<T,M,VfTag>::_evaluate_continued (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value_comp,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
{
check_macro (!_is_on_band, "test_component: not yet on band");
reference_element hat_K = K;
_initialize_numbering (omega_K, K);
size_type loc_comp_ndof = _last_loc_idof[hat_K.variant()] - _first_loc_idof[hat_K.variant()];
size_type loc_ndof = _loc_ndof [hat_K.variant()];
check_macro (size_type(value_comp.cols()) == loc_comp_ndof,
"omega_K="<<omega_K.name()<<", K="<<K.name()<<K.dis_ie()
<<", space="<<_u.get_vf_space().name()<<", i_comp="<<_i_comp<<", comp_space="<<_u_comp.get_vf_space().name()
<<", value_comp("<<value_comp.rows()<<","<<value_comp.cols()<<") has incompatible cols size : expect loc_comp_ndof="<<loc_comp_ndof
<< " associated to local dof sub-range ["<<_first_loc_idof[hat_K.variant()]<<":"<< _last_loc_idof[hat_K.variant()]<<"["
<< " in full local dof range [0:"<<loc_ndof<<"[");
size_type loc_nnod = value_comp.rows();
value.resize (loc_nnod, loc_ndof);
value.fill (Value());
for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
for (size_type loc_jdof = _first_loc_idof[hat_K.variant()], loc_comp_jdof = 0; loc_comp_jdof < loc_comp_ndof; ++loc_jdof, ++loc_comp_jdof) {
value (loc_inod,loc_jdof) = value_comp (loc_inod,loc_comp_jdof);
}}
}
template <class T, class M, class VfTag>
template<class Value, details::differentiate_option::type Diff>
void
test_component_rep<T,M,VfTag>::evaluate_on_side (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const side_information_type& sid,
const details::differentiate_option& gopt,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value,
bool do_local_component_assembly) const
{
if (!do_local_component_assembly) {
// DG on an internal side: compute only one-side value here
// as it is bi-valued, it will be later assembled by local_dg_merge_on_side(), when the two values are computed
_u_comp.template evaluate_on_side<Value,Diff> (omega_K, K, sid, gopt, value, do_local_component_assembly);
return;
}
// on_local_side(DG); is uni-valued as the inner value, then assembled immediately
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic> value_comp;
_u_comp.template evaluate_on_side<Value,Diff> (omega_K, K, sid, gopt, value_comp, do_local_component_assembly);
_evaluate_on_side_continued (omega_K, K, sid, value_comp, value);
}
template <class T, class M, class VfTag>
template<class Value>
void
test_component_rep<T,M,VfTag>::_evaluate_on_side_continued (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const side_information_type& sid,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value_comp,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
{
check_macro (!_is_on_band, "test_component: not yet on band");
check_macro (K.dimension() > 0, "unexpected 0D element for HDG multiplier");
size_type sid_map_d = K.dimension() - 1;
_initialize_numbering (omega_K, K);
reference_element hat_K = K;
size_type first_loc_jdof = _first_loc_idof [hat_K.variant()];
size_type loc_comp_ndof = _last_loc_idof [hat_K.variant()] - _first_loc_idof[hat_K.variant()];
size_type loc_ndof = _loc_ndof [hat_K.variant()];
check_macro (size_type(value_comp.cols()) == loc_comp_ndof,
"omega_K="<<omega_K.name()<<", K="<<K.name()<<K.dis_ie()
<<", space="<<_u.get_vf_space().name()<<", i_comp="<<_i_comp<<", comp_space="<<_u_comp.get_vf_space().name()
<<", value_comp("<<value_comp.rows()<<","<<value_comp.cols()<<") has incompatible cols size : expect loc_comp_ndof="<<loc_comp_ndof
<< " associated to local dof sub-range ["<<_first_loc_idof[hat_K.variant()]<<":"<< _last_loc_idof[hat_K.variant()]<<"["
<< " in full local dof range [0:"<<loc_ndof<<"[");
check_macro (first_loc_jdof + loc_comp_ndof <= loc_ndof, "invalid sizes");
size_type loc_nnod = value_comp.rows();
value.resize (loc_nnod, loc_ndof);
value.fill (Value());
for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
for (size_type loc_jdof = first_loc_jdof, loc_comp_jdof = 0; loc_comp_jdof < loc_comp_ndof; ++loc_jdof, ++loc_comp_jdof) {
value (loc_inod,loc_jdof) = value_comp (loc_inod,loc_comp_jdof);
}}
}
template <class T, class M, class VfTag>
template<class Value>
void
test_component_rep<T,M,VfTag>::local_dg_merge_on_side (
const geo_basic<T,M>& omega_K,
const geo_element& S,
const geo_element& K0,
const geo_element& K1,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value_comp0,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value_comp1,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
{
trace_macro("local_dg_merge_on_side: omega_K="<<omega_K.name()<<", S="<<S.name()<<S.dis_ie()<<"...");
_initialize_numbering (omega_K, S);
reference_element hat_S = S;
size_type loc_nnod = value_comp0.rows();
size_type loc_ndof = _loc_ndof [hat_S.variant()];
size_type loc_comp_ndof = _last_loc_idof [hat_S.variant()] - _first_loc_idof[hat_S.variant()];
size_type first_loc_jdof = _first_loc_idof [hat_S.variant()];
check_macro (size_type(value_comp0.cols() + value_comp1.cols()) == loc_comp_ndof,
"omega_K="<<omega_K.name()<<", S="<<S.name()<<S.dis_ie()
<<", space="<<_u.get_vf_space().name()<<", i_comp="<<_i_comp<<", comp_space="<<_u_comp.get_vf_space().name()
<<", value_comp0("<<value_comp0.rows()<<","<<value_comp0.cols()<<") and "
<< " value_comp1("<<value_comp1.rows()<<","<<value_comp1.cols()<<") have incompatible cols sizes : expect loc_comp_ndof="<<loc_comp_ndof
<< " associated to local dof sub-range ["<<_first_loc_idof[hat_S.variant()]<<":"<< _last_loc_idof[hat_S.variant()]<<"["
<< " in full local dof range [0:"<<loc_ndof<<"[");
check_macro (value_comp0.rows() == value_comp1.rows(), "invalid sizes");
check_macro (first_loc_jdof + loc_comp_ndof <= loc_ndof, "invalid sizes");
value.resize (loc_nnod, loc_ndof);
value.fill (Value());
for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
for (size_type loc_jdof = first_loc_jdof, loc_comp0_jdof = 0, loc_comp0_ndof = value_comp0.cols();
loc_comp0_jdof < loc_comp0_ndof; ++loc_jdof, ++loc_comp0_jdof) {
value (loc_inod,loc_jdof) = value_comp0 (loc_inod,loc_comp0_jdof);
}
for (size_type loc_jdof = first_loc_jdof + value_comp0.cols(), loc_comp1_jdof = 0, loc_comp1_ndof = value_comp1.cols();
loc_comp1_jdof < loc_comp1_ndof; ++loc_jdof, ++loc_comp1_jdof) {
value (loc_inod,loc_jdof) = value_comp1 (loc_inod,loc_comp1_jdof);
}
}
trace_macro("local_dg_merge_on_side: omega_K="<<omega_K.name()<<", S="<<S.name()<<S.dis_ie()<<" done");
}
// =========================================================================
// test_component
// =========================================================================
template <class T, class M, class VfTag>
class test_component: public smart_pointer<test_component_rep<T,M,VfTag> > {
public:
// typename:
typedef test_component_rep<T,M,VfTag> rep;
typedef smart_pointer<rep> base;
typedef test_basic<T,M,VfTag> test_type;
typedef typename test_type::size_type size_type;
typedef typename test_type::value_type value_type;
typedef M memory_type;
typedef typename test_type::scalar_type scalar_type;
typedef typename test_type::float_type float_type;
typedef details::differentiate_option::type diff_type;
typedef geo_basic<float_type,M> geo_type;
typedef space_basic<float_type,M> space_type;
typedef VfTag vf_tag_type;
typedef typename details::dual_vf_tag<VfTag>::type
vf_dual_tag_type;
typedef test_component<T,M,VfTag> self_type;
typedef test_component<T,M,vf_dual_tag_type> dual_self_type;
// allocators:
test_component () : base(0) {}
test_component (const test_component<T,M,VfTag>& u) : base(u) {}
test_component (const test_basic<T,M,VfTag>& u, size_type i_comp) : base(new_macro(rep(u,i_comp))) {}
test_component (const test_component<T,M,VfTag>& u, size_type i_comp) : base(new_macro(rep(u,i_comp))) {}
// recursive call:
test_component<T,M,VfTag> operator[] (size_t i_comp) const { return test_component<T,M,VfTag> (*this, i_comp); }
// accessors:
const space_type& get_vf_space() const { return base::data().get_vf_space(); }
static const space_constant::valued_type valued_hint = rep::valued_hint;
space_constant::valued_type valued_tag() const { return base::data().valued_tag(); }
size_type n_derivative() const { return 0; }
// initializers:
void initialize (
const piola_on_pointset<T>& pops,
const integrate_option& iopt)
{ base::data().initialize (pops, iopt); }
void initialize (
const band_basic<float_type,memory_type>& gh,
const piola_on_pointset<T>& pops,
const integrate_option& iopt)
{ base::data().initialize (gh, pops, iopt); }
void initialize (
const space_basic<float_type,memory_type>& Xh,
const integrate_option& iopt)
{ base::data().initialize (Xh, iopt); }
// evaluators:
template<class Value, diff_type Diff>
void evaluate (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const details::differentiate_option& gopt,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
{ return base::data().template evaluate<Value,Diff> (omega_K, K, gopt, value); }
template<class Value, diff_type Diff>
void evaluate_on_side (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const side_information_type& sid,
const details::differentiate_option& gopt,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value,
bool do_local_component_assembly) const
{ return base::data().template evaluate_on_side<Value,Diff> (omega_K, K, sid, gopt, value, do_local_component_assembly); }
// abbreviation: evaluate without differentiation
template<class Value>
void evaluate (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
{
details::differentiate_option none;
base::data().template evaluate<Value,details::differentiate_option::none> (omega_K, K, none, value);
}
template<class Value>
void evaluate_on_side (
const geo_basic<float_type,memory_type>& omega_K,
const geo_element& K,
const side_information_type& sid,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value,
bool do_local_component_assembly) const
{
details::differentiate_option none;
base::data().template evaluate_on_side<Value,details::differentiate_option::none> (omega_K, K, sid, none, value, do_local_component_assembly);
}
template<class Value>
void local_dg_merge_on_side (
const geo_basic<T,M>& omega_K,
const geo_element& S,
const geo_element& K0,
const geo_element& K1,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value0,
const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value1,
Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
{ return base::data().local_dg_merge_on_side (omega_K, S, K0, K1, value0, value1, value); }
// checks:
template<class ValueType>
void valued_check() const { base::data().template valued_check<ValueType>(); }
template<class ValueType>
void grad_valued_check() const { base::data().template grad_valued_check<ValueType>(); }
template<class ValueType>
void div_valued_check() const { base::data().template div_valued_check<ValueType>(); }
};
} // namespace details
// -------------------------------------------------------------------------
// test_basic accessor:
// -------------------------------------------------------------------------
template <class T, class M, class VfTag>
inline
details::test_component<T,M,VfTag>
test_basic<T,M,VfTag>::operator[] (size_type i_comp) const
{
return details::test_component<T,M,VfTag> (*this, i_comp);
}
} // namespace rheolef
#endif // _RHEOLEF_TEST_COMPONENT_H
size_type
field::size_type size_type
Definition branch.cc:430
gh
field gh(Float epsilon, Float t, const field &uh, const test &v)
Definition burgers_diffusion_operators.icc:37
rheolef::band_basic
Definition band.h:95
rheolef::details::test_component_rep
Definition test_component.h:33
rheolef::details::test_component_rep::evaluate
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const details::differentiate_option &gopt, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition test_component.h:264
rheolef::details::test_component_rep::_evaluate_continued
void _evaluate_continued(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value_comp, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition test_component.h:279
rheolef::details::test_component_rep::space_type
space_basic< float_type, M > space_type
Definition test_component.h:45
rheolef::details::test_component_rep::_first_loc_idof
std::array< size_type, reference_element::max_variant > _first_loc_idof
Definition test_component.h:161
rheolef::details::test_component_rep::float_type
test_type::float_type float_type
Definition test_component.h:43
rheolef::details::test_component_rep::initialize
void initialize(const piola_on_pointset< T > &pops, const integrate_option &iopt)
Definition test_component.h:62
rheolef::details::test_component_rep::test_type
test_basic< T, M, VfTag > test_type
Definition test_component.h:38
rheolef::details::test_component_rep::_u
test_basic< T, M, VfTag > _u
Definition test_component.h:152
rheolef::details::test_component_rep::evaluate_on_side
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const side_information_type &sid, const details::differentiate_option &gopt, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value, bool do_local_component_assembly) const
Definition test_component.h:307
rheolef::details::test_component_rep::_ptr_u_comp_upper_data
smart_pointer< test_component_rep< T, M, VfTag > > _ptr_u_comp_upper_data
Definition test_component.h:155
rheolef::details::test_component_rep::initialize
void initialize(const space_basic< float_type, memory_type > &Xh, const integrate_option &iopt)
Definition test_component.h:71
rheolef::details::test_component_rep::_has_subcomponent
bool _has_subcomponent() const
Definition test_component.h:154
rheolef::details::test_component_rep::div_valued_check
void div_valued_check() const
Definition test_component.h:122
rheolef::details::test_component_rep::grad_valued_check
void grad_valued_check() const
Definition test_component.h:114
rheolef::details::test_component_rep::scalar_type
test_type::scalar_type scalar_type
Definition test_component.h:42
rheolef::details::test_component_rep::_last_loc_idof
std::array< size_type, reference_element::max_variant > _last_loc_idof
Definition test_component.h:162
rheolef::details::test_component_rep::memory_type
M memory_type
Definition test_component.h:41
rheolef::details::test_component_rep::valued_check
void valued_check() const
Definition test_component.h:107
rheolef::details::test_component_rep::_loc_ndof
std::array< size_type, reference_element::max_variant > _loc_ndof
Definition test_component.h:160
rheolef::details::test_component_rep::_init_space_comp
static space_type _init_space_comp(const space_type &Xh, size_type i_comp)
Definition test_component.h:224
rheolef::details::test_component_rep::_i_comp
size_type _i_comp
Definition test_component.h:151
rheolef::details::test_component_rep::test_component_rep
test_component_rep(const test_basic< T, M, VfTag > &u, size_type i_comp)
Definition test_component.h:197
rheolef::details::test_component_rep::get_u_comp_upper_data
const test_component_rep< T, M, VfTag > & get_u_comp_upper_data() const
Definition test_component.h:153
rheolef::details::test_component_rep::valued_hint
static const space_constant::valued_type valued_hint
Definition test_component.h:57
rheolef::details::test_component_rep::initialize
void initialize(const band_basic< float_type, memory_type > &gh, const piola_on_pointset< T > &pops, const integrate_option &iopt)
Definition test_component.h:66
rheolef::details::test_component_rep::_is_on_band
bool _is_on_band
Definition test_component.h:163
rheolef::details::test_component_rep::operator=
test_component_rep< T, M, VfTag > & operator=(const test_component_rep< T, M, VfTag > &)
Definition test_component.h:183
rheolef::details::test_component_rep::value_type
test_type::value_type value_type
Definition test_component.h:40
rheolef::details::test_component_rep::diff_type
details::differentiate_option::type diff_type
Definition test_component.h:44
rheolef::details::test_component_rep::_u_comp
test_basic< T, M, VfTag > _u_comp
Definition test_component.h:152
rheolef::details::test_component_rep::_evaluate_on_side_continued
void _evaluate_on_side_continued(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const side_information_type &sid, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value_comp, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition test_component.h:329
rheolef::details::test_component_rep::size_type
test_type::size_type size_type
Definition test_component.h:39
rheolef::details::test_component_rep::local_dg_merge_on_side
void local_dg_merge_on_side(const geo_basic< T, M > &omega_K, const geo_element &S, const geo_element &K0, const geo_element &K1, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value0, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value1, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition test_component.h:362
rheolef::details::test_component_rep::valued_tag
space_constant::valued_type valued_tag() const
Definition test_component.h:58
rheolef::details::test_component_rep::_initialize_numbering
void _initialize_numbering(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K) const
Definition test_component.h:232
rheolef::details::test_component_rep::get_vf_space
const space_type & get_vf_space() const
Definition test_component.h:56
rheolef::details::test_component
Definition test_component.h:405
rheolef::details::test_component::evaluate
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition test_component.h:483
rheolef::details::test_component::operator[]
test_component< T, M, VfTag > operator[](size_t i_comp) const
Definition test_component.h:436
rheolef::details::test_component::evaluate
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const details::differentiate_option &gopt, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition test_component.h:464
rheolef::details::test_component::space_type
space_basic< float_type, M > space_type
Definition test_component.h:420
rheolef::details::test_component::float_type
test_type::float_type float_type
Definition test_component.h:417
rheolef::details::test_component::initialize
void initialize(const piola_on_pointset< T > &pops, const integrate_option &iopt)
Definition test_component.h:447
rheolef::details::test_component::test_type
test_basic< T, M, VfTag > test_type
Definition test_component.h:412
rheolef::details::test_component::evaluate_on_side
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const side_information_type &sid, const details::differentiate_option &gopt, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value, bool do_local_component_assembly) const
Definition test_component.h:472
rheolef::details::test_component::initialize
void initialize(const space_basic< float_type, memory_type > &Xh, const integrate_option &iopt)
Definition test_component.h:456
rheolef::details::test_component::div_valued_check
void div_valued_check() const
Definition test_component.h:523
rheolef::details::test_component::grad_valued_check
void grad_valued_check() const
Definition test_component.h:521
rheolef::details::test_component::evaluate_on_side
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const side_information_type &sid, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value, bool do_local_component_assembly) const
Definition test_component.h:492
rheolef::details::test_component::scalar_type
test_type::scalar_type scalar_type
Definition test_component.h:416
rheolef::details::test_component::dual_self_type
test_component< T, M, vf_dual_tag_type > dual_self_type
Definition test_component.h:425
rheolef::details::test_component::memory_type
M memory_type
Definition test_component.h:415
rheolef::details::test_component::test_component
test_component(const test_component< T, M, VfTag > &u)
Definition test_component.h:430
rheolef::details::test_component::valued_check
void valued_check() const
Definition test_component.h:519
rheolef::details::test_component::test_component
test_component(const test_basic< T, M, VfTag > &u, size_type i_comp)
Definition test_component.h:431
rheolef::details::test_component< T, M, vf_dual_tag_type >::valued_hint
static const space_constant::valued_type valued_hint
Definition test_component.h:441
rheolef::details::test_component::n_derivative
size_type n_derivative() const
Definition test_component.h:443
rheolef::details::test_component::initialize
void initialize(const band_basic< float_type, memory_type > &gh, const piola_on_pointset< T > &pops, const integrate_option &iopt)
Definition test_component.h:451
rheolef::details::test_component::base
smart_pointer< rep > base
Definition test_component.h:411
rheolef::details::test_component::value_type
test_type::value_type value_type
Definition test_component.h:414
rheolef::details::test_component::diff_type
details::differentiate_option::type diff_type
Definition test_component.h:418
rheolef::details::test_component::self_type
test_component< T, M, VfTag > self_type
Definition test_component.h:424
rheolef::details::test_component::rep
test_component_rep< T, M, VfTag > rep
Definition test_component.h:410
rheolef::details::test_component::size_type
test_type::size_type size_type
Definition test_component.h:413
rheolef::details::test_component::local_dg_merge_on_side
void local_dg_merge_on_side(const geo_basic< T, M > &omega_K, const geo_element &S, const geo_element &K0, const geo_element &K1, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value0, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value1, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition test_component.h:506
rheolef::details::test_component::test_component
test_component()
Definition test_component.h:429
rheolef::details::test_component::geo_type
geo_basic< float_type, M > geo_type
Definition test_component.h:419
rheolef::details::test_component::vf_tag_type
VfTag vf_tag_type
Definition test_component.h:421
rheolef::details::test_component::test_component
test_component(const test_component< T, M, VfTag > &u, size_type i_comp)
Definition test_component.h:432
rheolef::details::test_component::vf_dual_tag_type
details::dual_vf_tag< VfTag >::type vf_dual_tag_type
Definition test_component.h:423
rheolef::details::test_component::valued_tag
space_constant::valued_type valued_tag() const
Definition test_component.h:442
rheolef::details::test_component::get_vf_space
const space_type & get_vf_space() const
Definition test_component.h:440
rheolef::geo_basic
generic mesh with rerefence counting
Definition geo.h:1089
rheolef::geo_element
see the geo_element page for the full documentation
Definition geo_element.h:102
rheolef::geo_element::dimension
size_type dimension() const
Definition geo_element.h:167
rheolef::geo_element::variant
variant_type variant() const
Definition geo_element.h:161
rheolef::geo_element::dis_ie
size_type dis_ie() const
Definition geo_element.h:163
rheolef::geo_element::name
char name() const
Definition geo_element.h:169
rheolef::integrate_option
see the integrate_option page for the full documentation
Definition integrate_option.h:125
rheolef::piola_on_pointset
Definition piola_on_pointset.h:142
rheolef::reference_element
see the reference_element page for the full documentation
Definition reference_element.h:66
rheolef::reference_element::variant
variant_type variant() const
Definition reference_element.h:99
rheolef::smart_pointer_base::data
const T & data() const
Definition smart_pointer.h:266
rheolef::smart_pointer
see the smart_pointer page for the full documentation
Definition smart_pointer.h:351
rheolef::smart_pointer< test_component_rep< T, M, VfTag > >::smart_pointer
smart_pointer(T *p=0)
Definition smart_pointer.h:357
rheolef::space_basic
the finite element space
Definition space.h:382
rheolef::test_basic
Definition test.h:207
rheolef::test_basic::size_type
typename rep::size_type size_type
Definition test.h:213
rheolef::test_basic::value_type
typename rep::value_type value_type
Definition test.h:215
rheolef::test_basic::operator[]
details::test_component< T, M, VfTag > operator[](size_type i_comp) const
Definition test_component.h:534
rheolef::test_basic::float_type
typename rep::float_type float_type
Definition test.h:217
rheolef::test_basic::scalar_type
typename rep::scalar_type scalar_type
Definition test.h:216
trace_macro
#define trace_macro(message)
Definition dis_macros.h:111
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
mkgeo_ball.variant
int variant
Definition mkgeo_ball.sh:149
rheolef::details
Definition compiler_eigen.h:39
rheolef::space_constant::valued_type
valued_type
Definition space_constant.h:133
rheolef::space_constant::last_valued
@ last_valued
Definition space_constant.h:141
rheolef::space_constant::valued_name
const std::string & valued_name(valued_type valued_tag)
Definition space_constant.cc:43
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
rheolef::evaluate
void evaluate(const geo_basic< float_type, M > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
Definition field_expr_recursive.h:914
rheolef::evaluate_on_side
void evaluate_on_side(const geo_basic< float_type, M > &omega_K, const geo_element &K, const side_information_type &sid, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
Definition field_expr_recursive.h:935
rheolef::details::differentiate_option
Definition piola.h:41
rheolef::details::differentiate_option::type
type
Definition piola.h:42
rheolef::details::dual_vf_tag::type
vf_tag_nonlinear type
Definition field_expr_variational_tag.h:58
rheolef::side_information_type
Definition reference_element_face_transformation.h:37
rheolef::space_constant::rank_down::type
undeterminated_basic< typename scalar_traits< T >::type > type
Definition space_constant.h:178
rheolef::space_constant::rank_up::type
point_basic< typename scalar_traits< T >::type > type
Definition space_constant.h:184
rheolef::space_constant::valued_tag_traits::value
static const valued_type value
Definition space_constant.h:159
u
Definition leveque.h:25
M
Expr1::memory_type M
Definition vec_expr_v2.h:416