33 template <
int spacedim, class Value>
40 "Input file with ASCII GMSH file format.")
42 "The values of the Field are read from the ```$ElementData``` section with field name given by this key.")
49 template <
int spacedim,
class Value>
51 Input::register_class< FieldElementwise<spacedim, Value>,
unsigned int >(
"FieldElementwise") +
56 template <
int spacedim,
class Value>
59 internal_raw_data(true), mesh_(NULL), unit_si_(
UnitSI::dimensionless() )
67 template <
int spacedim,
class Value>
69 unsigned int n_components)
81 template <
int spacedim,
class Value>
114 template <
int spacedim,
class Value>
124 search_header.
actual=
false;
134 return search_header.actual;
139 template <
int spacedim,
class Value>
142 OLD_ASSERT(
mesh_ ==
nullptr ||
mesh_ == mesh,
"Trying to change mesh of the FieldElementwise.");
154 data_ = std::make_shared<std::vector<typename Value::element_type>>();
165 template <
int spacedim,
class Value>
174 return Value::from_raw(this->
r_value_, (
typename Value::element_type *)(&vec[idx]));
182 template <
int spacedim,
class Value>
193 typename Value::return_type
const &ref = Value::from_raw(this->
r_value_, (
typename Value::element_type *)(&vec[idx]));
194 for(
unsigned int i=0; i< value_list.size(); i++) {
196 "value_list[%d] has wrong number of rows: %d; should match number of components: %d\n",
197 i, Value(value_list[i]).n_rows(),this->
value_.n_rows());
202 xprintf(
UsrErr,
"FieldElementwise is not implemented for discrete return types.\n");
208 template <
int spacedim,
class Value>
211 if (Value::is_scalable()) {
213 for(
unsigned int i=0; i<vec.size(); ++i) {
217 WarningOut().fmt(
"Value '{}' of FieldElementwise '{}', element id '{}' at address '{}' is out of limits: <{}, {}>\n" 218 "Unit of the Field: [{}]\n",
227 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.
std::shared_ptr< std::vector< typename Value::element_type > > data_
Raw buffer of n_entities rows each containing Value::size() doubles.
std::string format_text() const
std::pair< double, double > limits_
virtual ~FieldElementwise()
Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm) override
unsigned int component_idx_
Specify if the field is part of a MultiField and which component it is.
bool is_boundary() const
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular...
#define INSTANCE_ALL(field)
Helper struct stores data for initizalize descentants of FieldAlgorithmBase.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
Value::return_type r_value_
virtual void init_from_input(const Input::Record &rec, const struct FieldAlgoBaseInitData &init_data) override
static constexpr bool value
double unit_conversion_coefficient_
Coeficient of conversion of user-defined unit.
unsigned int size() const
Returns size of the container. This is independent of the allocated space.
unsigned int n_elements() const
bool is_elemental() const
bool set_time(const TimeStep &time) override
vector< int > const & elements_id_maps(bool boundary_domain) const
void scale_and_check_limits()
Multiply data_ with unit_conversion_coefficient_ and check limits of field.
FieldElementwise(unsigned int n_comp=0)
ElementVector bc_elements
Space< spacedim >::Point Point
Dedicated class for storing path to input and output files.
unsigned int n_components_
Size of Value.
void set_mesh(const Mesh *mesh, bool boundary_domain) override
Value value_
Last value, prevents passing large values (vectors) by value.
unsigned int n_entities_
Number of rows in data_ buffer.
std::shared_ptr< GmshMeshReader > get_reader(const FilePath &file_path)
#define WarningOut()
Macro defining 'warning' record of log.
void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) override
#define OLD_ASSERT_EQUAL(a, b)
std::pair< double, double > limits_
Input::Record in_rec_
Accessor to Input::Record.
Class for representation SI units of Fields.
static ReaderInstances * instance()
Returns singleton instance.
#define DebugOut()
Macro defining 'debug' record of log.
Representation of one time step..
#define FLOW123D_FORCE_LINK_IN_CHILD(x)