18 #ifndef field_algo_base_IMPL_HH_
19 #define field_algo_base_IMPL_HH_
46 template <
int spacedim,
class Value>
51 unit_conversion_coefficient_(1.0)
58 template <
int spacedim,
class Value>
65 template <
int spacedim,
class Value>
69 return it::Abstract(
"Field_"+template_name(),
"Abstract for all time-space functions.")
77 template <
int spacedim,
class Value>
82 param_vec.push_back( std::make_pair(
"element_input_type", std::make_shared<it::Selection>(value_selection)) );
84 param_vec.push_back( std::make_pair(
"element_input_type", std::make_shared<typename Value::ElementInputType>()) );
90 template <
int spacedim,
class Value>
92 return it::Record(
"FieldAlgorithmBase_common_aux",
"")
94 "Unit of the field values provided in the main input file, in the external file, or "
95 "by a function (FieldPython).")
99 template <
int spacedim,
class Value>
100 shared_ptr< FieldAlgorithmBase<spacedim, Value> >
103 shared_ptr< FieldAlgorithmBase<spacedim, Value> > func;
111 template <
int spacedim,
class Value>
113 THROW( ExcInputInitUnsupported() << EI_Field(
typeid(
this).name()) );
118 template <
int spacedim,
class Value>
126 template <
int spacedim,
class Value>
132 template<
int spacedim,
class Value>
134 return (Value::NRows_ ? 0 : value_.n_rows());
138 template<
int spacedim,
class Value>
148 template<
int spacedim,
class Value>
153 template<
int spacedim,
class Value>
158 if ( rec.
opt_val(
"unit", unit_record) ) {
159 if (!Value::is_scalable()) {
160 WarningOut().fmt(
"Setting unit conversion coefficient of non-floating point field at address {}\nCoefficient will be skipped.\n",
163 std::string unit_str = unit_record.
val<std::string>(
"unit_formula");
166 }
catch (ExcInvalidUnit &e) {
169 }
catch (ExcNoncorrespondingUnit &e) {
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
Directing class of FieldValueCache.
static const Input::Type::Instance & get_input_type_instance(Input::Type::Selection value_selection=Input::Type::Selection())
static std::shared_ptr< FieldAlgorithmBase< spacedim, Value > > function_factory(const Input::AbstractRecord &rec, const struct FieldAlgoBaseInitData &init_data)
virtual void init_from_input(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
unsigned int n_comp() const
virtual void cache_update(FieldValueCache< typename Value::element_type > &data_cache, ElementCacheMap &cache_map, unsigned int region_patch_idx)
virtual void cache_reinit(const ElementCacheMap &cache_map)
Allows reinit data members or structures in descendants during reinit of FieldValueCache of 'parental...
static std::string template_name()
virtual bool set_time(const TimeStep &time)
static Input::Type::Abstract & get_input_type()
virtual void set_mesh(const Mesh *mesh)
void init_unit_conversion_coefficient(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data)
Init value of unit_conversion_coefficient_ from input.
static const Input::Type::Record & get_field_algo_common_keys()
Value value_
Last value, prevents passing large values (vectors) by value.
FieldAlgorithmBase(unsigned int n_comp=0)
Representation of one time step..
static const Input::Type::Record & get_input_type()
double convert_unit_from(std::string actual_unit) const
Convert and check user-defined unit.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
const unsigned int undef_idx
#define WarningOut()
Macro defining 'warning' record of log.
Helper struct stores data for initizalize descentants of FieldAlgorithmBase.
Basic time management class.