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());
141 #define INSTANCE_DIM_DEP_VALUES( field, dim_from, dim_to) \
142 template class field<dim_from, FieldValue<dim_to>::VectorFixed >; \
143 template class field<dim_from, FieldValue<dim_to>::TensorFixed >; \
146 #define INSTANCE_TO_ALL(field, dim_from) \
147 template class field<dim_from, FieldValue<0>::Enum >; \
148 template class field<dim_from, FieldValue<0>::EnumVector >; \
149 template class field<dim_from, FieldValue<0>::Integer >; \
150 template class field<dim_from, FieldValue<0>::Scalar >; \
151 template class field<dim_from, FieldValue<0>::Vector >; \
153 INSTANCE_DIM_DEP_VALUES( field, dim_from, 2) \
154 INSTANCE_DIM_DEP_VALUES( field, dim_from, 3) \
165 #define INSTANCE_ALL(field) \
166 INSTANCE_TO_ALL( field, 3) \
167 INSTANCE_TO_ALL( field, 2)
174 #endif //FUNCTION_BASE_IMPL_HH_