31 IT::Selection(
"Discrete_output",
"Discrete type of output. Determines type of output data (element, node, native etc).")
33 "Continuous linear interpolation. Evaluates average of FE basis functions at nodes."
34 "Continuous mesh: NodeData (GMSH) / PointData(VTK)."
35 "Discontinuous mesh: ElementNodeData (GMSH) / PointData(VTK)")
37 "Piecewise linear interpolation (discontinuous between elements)."
38 "Continuous mesh: NodeData (GMSH) / PointData(VTK)."
39 "Discontinuous mesh: ElementNodeData (GMSH) / PointData(VTK)")
41 "Piecewise constant interpolation."
42 "Continuous mesh: ElementData (GMSH) / CellData(VTK)."
43 "Discontinuous mesh: ElementData (GMSH) / CellData(VTK)")
45 "Native data (Flow123d data). Corresponds to degrees of freedom of the internal FE approximation."
46 "Its main purpose is to read/write results repeatedly with minimal loss of accuracy.")
49 static const IT::Record &field_output_setting =
50 IT::Record(
"FieldOutputSetting",
"Setting of the field output. The field name, output times, output interpolation (future).")
53 "The field name (of equation field or user field).")
55 "Output times specific to particular field.")
57 "Optional value. Implicit value is given by field and can be changed.")
61 "Output of the equation's fields."
62 "The output is done through the output stream of the associated balance law equation."
63 "The stream defines output format for the full space information in selected times and "
64 "observe points for the full time information. The key 'fields' select the fields for the full spatial output."
65 "The set of output times may be specified per field otherwise common time set 'times' is used. If even this is not provided"
66 "the time set of the output_stream is used. The initial time of the equation is automatically added "
67 "to the time set of every selected field. The end time of the equation is automatically added "
68 "to the common output time set.")
71 "Output times used for the output fields without is own time series specification.")
73 "Add all input time points of the equation, mentioned in the 'input_fields' list, also as the output points.")
75 "Array of output fields and their individual output settings.")
77 "Array of the fields evaluated in the observe points of the associated output stream.")
83 :
FieldSet(), output_elem_data_assembly_(nullptr), output_node_data_assembly_(nullptr), output_corner_data_assembly_(nullptr),
84 observe_output_assembly_(nullptr) {
98 const string &additional_description)
100 string selection_name = equation_name +
":OutputFields";
101 string description =
"Selection of output fields for the " + equation_name +
" model.\n" + additional_description;
110 string desc =
"(($[" +
field->
units().format_latex()+
"]$)) "; +
"Output of: the field " +
field->
name() +
" ";
112 desc +=
"Input field: ";
115 sel.
add_value(i,
field->
name(), desc, { {FlowAttribute::field_value_shape(), field->get_value_attribute()} });
129 const string &equation_name,
130 const string &additional_description)
135 param_vec.push_back( std::make_pair(
"output_field_selection", std::make_shared< IT::Selection >(output_field_selection) ) );
150 dh_ = make_shared<DOFHandlerMultiDim>(*
mesh_);
151 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>(
mesh_, fe_p_disc);
152 dh_->distribute_dofs(ds);
158 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>(
mesh_, fe_p_disc);
172 ASSERT(
stream_).error(
"The 'set_stream' method must be called before the 'read_from_input'.");
176 if (in_rec.
opt_val(
"times", times_array) ) {
180 auto times_array_it =
stream_->get_time_set_array();
181 if (times_array_it) {
188 if (in_rec.
val<
bool>(
"add_input_times")) {
201 auto observe_fields_array = in_rec.
val<
Input::Array>(
"observe_fields");
202 for(
auto it = observe_fields_array.begin<
Input::FullEnum>();
it != observe_fields_array.end(); ++
it) {
209 string field_name =
it -> val< std::string >(
"field");
215 if (
it->opt_val(
"interpolation", interpolations)) {
218 interpolation[ *it_interp ] =
true;
225 if (
it->opt_val(
"times", field_times_array)) {
240 for (
uint i_comp=0; i_comp<found_field->
n_comp(); ++i_comp) {
255 auto current_mark_it = marks.current(step,
equation_type_ | marks.type_output() );
256 if (current_mark_it == marks.end(
equation_type_ | marks.type_output()) )
return false;
257 return (field_times_it->second.output_set_.contains(*current_mark_it) );
266 if (step.
end() >
stream_->registered_time()) {
281 used_fields += *(f_acc.field());
284 if (used_fields.size()>0) {
286 mixed_assmbly[1_d]->set_output_data(used_fields,
stream_);
287 mixed_assmbly[2_d]->set_output_data(used_fields,
stream_);
288 mixed_assmbly[3_d]->set_output_data(used_fields,
stream_);
299 used_fields += *(f_acc.field());
302 if (used_fields.size()>0) {
304 mixed_assmbly[1_d]->set_output_data(used_fields,
stream_);
305 mixed_assmbly[2_d]->set_output_data(used_fields,
stream_);
306 mixed_assmbly[3_d]->set_output_data(used_fields,
stream_);
317 used_fields += *(f_acc.field());
320 if (used_fields.size()>0) {
322 mixed_assmbly[1_d]->set_output_data(used_fields,
stream_);
323 mixed_assmbly[2_d]->set_output_data(used_fields,
stream_);
324 mixed_assmbly[3_d]->set_output_data(used_fields,
stream_);
339 auto *field_ptr = this->
field(observe_field);
341 if (field_ptr->is_multifield()) {
342 for (
uint i_comp=0; i_comp<field_ptr->n_comp(); ++i_comp) {
343 observe_ptr->prepare_compute_data(field_ptr->full_comp_name(i_comp), step.
end(), field_ptr->n_shape());
346 observe_ptr->prepare_compute_data(field_ptr->name(), field_ptr->time(), field_ptr->n_shape());
364 if (
stream_->is_output_data_caches_init())
return;
367 bool need_refinment =
stream_->get_output_mesh_record();
370 if(
stream_->enable_refinement()) {
388 WarningOut() <<
"Ignoring output mesh record.\n Output in GMSH format available only on computational mesh!";
412 std::string error_control_field_name =
"";
414 auto it =
stream_->get_output_mesh_record()->find<std::string>(
"error_control_field");
415 if(
it) error_control_field_name = *
it;
417 if(error_control_field_name!=
"")
421 if(
field ==
nullptr){
422 THROW(FieldSet::ExcUnknownField()
423 << FieldCommon::EI_Field(error_control_field_name));
429 ASSERT_PERMANENT(
false)(error_control_field_name).error(
"Setting of error control field is not supported yet!\n");
442 THROW(ExcFieldNotScalar()
443 << FieldCommon::EI_Field(error_control_field_name));
#define ASSERT_PERMANENT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
#define ASSERT_PERMANENT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR) only for debug mode.
TimeMark::Type equation_type_
The time mark type of the equation.
void initialize(std::shared_ptr< OutputTime > stream, Mesh *mesh, Input::Record in_rec, const TimeGovernor &tg)
const Input::Type::Selection & create_output_field_selection(const string &equation_name, const string &additional_description)
const Input::Type::Instance & make_output_type_from_record(Input::Type::Record &in_rec, const string &equation_name, const string &aditional_description="")
EquationOutput()
Default constructor.
void read_from_input(Input::Record in_rec, const TimeGovernor &tg)
GenericAssemblyObserve< AssemblyObserveOutput > * observe_output_assembly_
std::unordered_set< string > observe_fields_
Set of observed fields. The observe points are given within the observe stream.
bool is_field_output_time(const FieldCommon &field, TimeStep step) const
void init_field_item(Input::Iterator< Input::Record > it, const TimeGovernor &tg)
Initialize data of Field given by passed Input::Record.
GenericAssembly< AssemblyOutputNodeData > * output_node_data_assembly_
TimeMark::Type equation_fixed_type_
The fixed time mark type of the equation.
std::set< OutputTime::DiscreteSpace > used_interpolations_
OutputMeshBase::ErrorControlFieldFunc select_error_control_field()
Selects the error control field out of output field set according to input record.
void output(TimeStep step)
const Input::Type::Instance & make_output_type(const string &equation_name, const string &aditional_description="")
~EquationOutput()
Destructor.
OutputTimeSet common_output_times_
The time set used for the fields without explicit time set.
std::shared_ptr< DOFHandlerMultiDim > dh_node_
std::shared_ptr< OutputTime > stream_
output stream (may be shared by more equation)
std::shared_ptr< OutputMeshBase > output_mesh_
Output mesh.
static Input::Type::Record & get_input_type()
std::shared_ptr< DOFHandlerMultiDim > dh_
Objects for distribution of dofs.
GenericAssembly< AssemblyOutputNodeData > * output_corner_data_assembly_
void make_output_mesh(bool parallel)
GenericAssembly< AssemblyOutputElemData > * output_elem_data_assembly_
general assembly objects, hold assembly objects of appropriate dimension
std::unordered_map< string, FieldOutputConfig > field_output_times_
Time sets of individual fields.
void add_output_times(double begin, double step, double end)
Common abstract parent of all Field<...> classes.
OutputTime::DiscreteSpace get_output_type() const
std::string full_comp_name(unsigned int i_comp) const
FieldCommon & description(const string &description)
FieldCommon & flags(FieldFlag::Flags::Mask mask)
FieldCommon & name(const string &name)
FieldFlag::Flags get_flags() const
bool is_multifield() const
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
unsigned int n_comp() const
static constexpr Mask allow_output
The field can output. Is part of generated output selection. (default on)
static constexpr Mask equation_input
The field is data parameter of the owning equation. (default on)
Container for various descendants of FieldCommonBase.
Range< FieldListAccessor > fields_range() const
Returns range of Fields held in field_list.
const Mesh * mesh() const
Returns pointer to mesh.
FieldCommon * field(const std::string &field_name) const
std::vector< FieldCommon * > field_list
List of all fields.
Class template representing a field with values dependent on: point, element, and region.
constexpr bool match(Mask mask) const
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
MixedPtr< DimAssembly, 1 > multidim_assembly() const
Getter to set of assembly objects.
std::function< void(const Armor::array &, const ElementAccessor< spacedim > &, std::vector< double > &)> ErrorControlFieldFunc
static const Input::Type::Array get_input_type()
void read_from_input(Input::Array in_array, const TimeGovernor &tg)
void add(double begin, TimeMark::Type mark_type)
std::array< bool, 4 > DiscreteSpaceFlags
static const unsigned int N_DISCRETE_SPACES
static DiscreteSpaceFlags empty_discrete_flags()
Check if at least one of discrete space flag is set to true.
static void set_discrete_flag(DiscreteSpaceFlags &dsf, DiscreteSpace d_space)
Basic time management functionality for unsteady (and steady) solvers (class Equation).
TimeMark::Type equation_fixed_mark_type() const
double end_time() const
End time.
TimeMark::Type equation_mark_type() const
static TimeMarks & marks()
This class is a collection of time marks to manage various events occurring during simulation time.
TimeMarks::iterator begin(TimeMark::Type mask) const
Iterator for the begin mimics container-like of TimeMarks.
TimeMarks::iterator end(TimeMark::Type mask) const
Iterator for the end mimics container-like of TimeMarks.
Representation of one time step..
bool eq(double other_time) const
Declaration of class which provides the finite element for every mesh cell.
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
Definitions of basic Lagrangean finite elements with polynomial shape functions.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
#define WarningOut()
Macro defining 'warning' record of log.
Configuration of output of one field. Pair of OutputTimeSet and DiscreteSpaces.
OutputTimeSet output_set_
Set of output times.
OutputTime::DiscreteSpaceFlags space_flags_
Array of used DiscreteSpaces.