9 #ifndef FIELD_BASE_IMPL_HH_
10 #define FIELD_BASE_IMPL_HH_
27 namespace it = Input::Type;
34 template <
int spacedim,
class Value>
36 : time_( -numeric_limits<double>::infinity() ),
44 template <
int spacedim,
class Value>
46 return boost::str(boost::format(
"R%i -> %s") % spacedim % Value::type_name() );
51 template <
int spacedim,
class Value>
53 =
it::AbstractRecord(
"Field:"+template_name(),
"Abstract record for all time-space functions.")
58 template <
int spacedim,
class Value>
76 template <
int spacedim,
class Value>
77 shared_ptr< FieldBase<spacedim, Value> >
80 shared_ptr< FieldBase<spacedim, Value> > func;
84 func=make_shared< FieldInterpolatedP0<spacedim,Value> >(n_comp);
87 func=make_shared< FieldPython<spacedim, Value> >(n_comp);
90 func=make_shared< FieldConstant<spacedim,Value> >(n_comp);
92 func=make_shared< FieldFormula<spacedim,Value> >(n_comp);
94 func=make_shared< FieldElementwise<spacedim,Value> >(n_comp);
96 xprintf(
PrgErr,
"TYPE of Field is out of set of descendants. SHOULD NOT HAPPEN.\n");
98 func->init_from_input(rec);
104 template <
int spacedim,
class Value>
106 xprintf(
PrgErr,
"The field '%s' do not support initialization from input.\n",
107 typeid(
this).name());
112 template <
int spacedim,
class Value>
120 template <
int spacedim,
class Value>
126 template<
int spacedim,
class Value>
128 return (Value::NRows_ ? 0 : value_.n_rows());
143 #define INSTANCE_DIM_DEP_VALUES( field, dim_from, dim_to) \
144 template class field<dim_from, FieldValue<dim_to>::VectorFixed >; \
145 template class field<dim_from, FieldValue<dim_to>::TensorFixed >; \
148 #define INSTANCE_TO_ALL(field, dim_from) \
149 template class field<dim_from, FieldValue<0>::Enum >; \
150 template class field<dim_from, FieldValue<0>::EnumVector >; \
151 template class field<dim_from, FieldValue<0>::Integer >; \
152 template class field<dim_from, FieldValue<0>::Scalar >; \
153 template class field<dim_from, FieldValue<0>::Vector >; \
155 INSTANCE_DIM_DEP_VALUES( field, dim_from, 2) \
156 INSTANCE_DIM_DEP_VALUES( field, dim_from, 3) \
167 #define INSTANCE_ALL(field) \
168 INSTANCE_TO_ALL( field, 3) \
169 INSTANCE_TO_ALL( field, 2)
176 #endif //FUNCTION_BASE_IMPL_HH_