31 template <
int spacedim, class
Value>
38 "Value of the constant field. " 39 "For vector values, you can use scalar value to enter constant vector. " 40 "For square (($N\\times N$))-matrix values, you can use: " 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." )
50 template <
int spacedim,
class Value>
52 Input::register_class< FieldConstant<spacedim, Value>,
unsigned int >(
"FieldConstant") +
56 template <
int spacedim,
class Value>
64 template <
int spacedim,
class Value>
73 template <
int spacedim,
class Value>
78 this->
value_.init_from_input( rec.
val<
typename Value::AccessType>(
"value") );
82 typename Value::return_type tmp_value;
83 Value tmp_field_value(tmp_value);
84 tmp_field_value.set_n_comp(this->
n_comp());
86 tmp_field_value.zeros();
87 if ( this->
value_.equal_to(tmp_value) ) {
93 tmp_field_value.ones();
94 if ( this->
value_.equal_to(tmp_value) ) {
101 tmp_field_value.eye();
102 if ( this->
value_.equal_to(tmp_value) ) {
116 template <
int spacedim,
class Value>
127 template <
int spacedim,
class Value>
133 for(
unsigned int i=0; i< point_list.size(); i++) {
135 "value_list[%d] has wrong number of rows: %d; should match number of components: %d\n",
136 i,
Value(value_list[i]).n_rows(),this->
value_.n_rows());
144 template <
int spacedim,
class Value>
147 if (Value::is_scalable())
148 for(
unsigned int row=0; row<this->
value_.n_rows(); row++)
149 for(
unsigned int col=0; col<this->
value_.n_cols(); col++) {
151 WarningOut().fmt(
"Value '{}' of Field '{}' at address '{}' is out of limits: <{}, {}>\nUnit of the Field: [{}]\n",
160 template <
int spacedim,
class Value>
void init_unit_conversion_coefficient(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
Init value of unit_conversion_coefficient_ from input.
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) override
void check_field_limits(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
Compare field value with given minimal and maximal limits.
FieldConstant< spacedim, Value > & set_value(const typename Value::return_type &val)
std::string format_text() const
FieldResult field_result_
Indicator of particular values (zero, one) constant over space.
#define INSTANCE_ALL(field)
Helper struct stores data for initizalize descentants of FieldAlgorithmBase.
Value::return_type r_value_
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm) override
double unit_conversion_coefficient_
Coeficient of conversion of user-defined unit.
FieldConstant(unsigned int n_comp=0)
virtual void init_from_input(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data) override
Space< spacedim >::Point Point
bool is_constant_in_space_
Flag detects that field is only dependent on time.
Value value_
Last value, prevents passing large values (vectors) by value.
#define WarningOut()
Macro defining 'warning' record of log.
#define OLD_ASSERT_EQUAL(a, b)
std::pair< double, double > limits_
#define FLOW123D_FORCE_LINK_IN_CHILD(x)
unsigned int n_comp() const