18 #ifndef field_algo_base_IMPL_HH_ 19 #define field_algo_base_IMPL_HH_ 49 template <
int spacedim,
class Value>
53 component_idx_(
std::numeric_limits<unsigned int>::max())
60 template <
int spacedim,
class Value>
62 return boost::str(boost::format(
"R%i -> %s") % spacedim % Value::type_name() );
67 template <
int spacedim,
class Value>
70 ss <<
"[" << Value::NRows_ <<
", " << Value::NCols_ <<
"]";
79 template <
int spacedim,
class Value>
83 OLD_ASSERT(value_selection,
"Not defined 'value_selection' for enum element type.\n");
84 param_vec.push_back( std::make_pair(
"element_input_type", std::make_shared<it::Selection>(*value_selection)) );
86 param_vec.push_back( std::make_pair(
"element_input_type", std::make_shared<typename Value::ElementInputType>()) );
94 template <
int spacedim,
class Value>
95 shared_ptr< FieldAlgorithmBase<spacedim, Value> >
98 shared_ptr< FieldAlgorithmBase<spacedim, Value> > func;
106 template <
int spacedim,
class Value>
108 xprintf(
PrgErr,
"The field '%s' do not support initialization from input.\n",
109 typeid(
this).name());
114 template <
int spacedim,
class Value>
122 template <
int spacedim,
class Value>
128 template<
int spacedim,
class Value>
130 return (Value::NRows_ ? 0 :
value_.n_rows());
135 template<
int spacedim,
class Value>
142 for(
unsigned int i=0; i< point_list.size(); i++) {
144 "value_list[%d] has wrong number of rows: %d; should match number of components: %d\n",
145 i, Value(value_list[i]).n_rows(),this->
value_.n_rows());
146 value_list[i]=this->
value(point_list[i], elm);
159 #define INSTANCE_DIM_DEP_VALUES( field, dim_from, dim_to) \ 160 template class field<dim_from, FieldValue<dim_to>::VectorFixed >; \ 161 template class field<dim_from, FieldValue<dim_to>::TensorFixed >; \ 164 #define INSTANCE_TO_ALL(field, dim_from) \ 165 template class field<dim_from, FieldValue<0>::Enum >; \ 166 template class field<dim_from, FieldValue<0>::EnumVector >; \ 167 template class field<dim_from, FieldValue<0>::Integer >; \ 168 template class field<dim_from, FieldValue<0>::Scalar >; \ 169 template class field<dim_from, FieldValue<0>::Vector >; \ 171 INSTANCE_DIM_DEP_VALUES( field, dim_from, 2) \ 172 INSTANCE_DIM_DEP_VALUES( field, dim_from, 3) \ 177 #define INSTANCE_ALL(field) \ 178 INSTANCE_TO_ALL( field, 3) \ 179 INSTANCE_TO_ALL( field, 2) 185 #endif //FUNCTION_BASE_IMPL_HH_ TimeStep time_
Actual time level; initial value is -infinity.
virtual bool set_time(const TimeStep &time)
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)=0
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)=0
Basic time management class.
static constexpr bool is_enum_valued
static const Input::Type::Instance & get_input_type_instance(const Input::Type::Selection *value_selection=NULL)
static std::shared_ptr< FieldAlgorithmBase< spacedim, Value > > function_factory(const Input::AbstractRecord &rec, unsigned int n_comp=0)
static string field_value_shape()
FieldAlgorithmBase(unsigned int n_comp=0)
Value value_
Last value, prevents passing large values (vectors) by value.
static Input::Type::Abstract & get_input_type()
virtual void set_mesh(const Mesh *mesh, bool boundary_domain)
#define OLD_ASSERT_EQUAL(a, b)
static std::string template_name()
Representation of one time step..
unsigned int n_comp() const
virtual void init_from_input(const Input::Record &rec)