18 #ifndef FIELD_CONSTANT_IMPL_HH_ 19 #define FIELD_CONSTANT_IMPL_HH_ 32 template <
int spacedim, class Value>
38 "Value of the constant field.\n" 39 "For vector values, you can use scalar value to enter constant vector.\n" 40 "For square (($N\\times N$))-matrix values, you can use:\n" 41 " - vector of size (($N$)) to enter diagonal matrix\n\n" 42 " - vector of size (($\\frac12N(N+1)$)) to enter symmetric matrix (upper triangle, row by row)\n" 43 " - scalar to enter multiple of the unit matrix." )
48 template <
int spacedim,
class Value>
50 Input::register_class< FieldConstant<spacedim, Value>,
unsigned int >(
"FieldConstant") +
54 template <
int spacedim,
class Value>
60 template <
int spacedim,
class Value>
69 template <
int spacedim,
class Value>
71 this->
value_.init_from_input( rec.
val<
typename Value::AccessType>(
"value") );
73 typename Value::return_type tmp_value;
74 Value tmp_field_value(tmp_value);
75 tmp_field_value.set_n_comp(this->
n_comp());
77 tmp_field_value.zeros();
78 if ( this->
value_.equal_to(tmp_value) ) {
84 tmp_field_value.ones();
85 if ( this->
value_.equal_to(tmp_value) ) {
92 tmp_field_value.eye();
93 if ( this->
value_.equal_to(tmp_value) ) {
107 template <
int spacedim,
class Value>
118 template <
int spacedim,
class Value>
124 for(
unsigned int i=0; i< point_list.size(); i++) {
126 "value_list[%d] has wrong number of rows: %d; should match number of components: %d\n",
127 i, Value(value_list[i]).n_rows(),this->
value_.n_rows());
136 template <
int spacedim,
class Value>
FieldConstant< spacedim, Value > & set_value(const typename Value::return_type &val)
virtual void init_from_input(const Input::Record &rec)
FieldResult field_result_
Indicator of particular values (zero, one) constant over space.
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)
Value::return_type r_value_
FieldConstant(unsigned int n_comp=0)
Space< spacedim >::Point Point
Value value_
Last value, prevents passing large values (vectors) by value.
#define OLD_ASSERT_EQUAL(a, b)
#define FLOW123D_FORCE_LINK_IN_CHILD(x)
unsigned int n_comp() const