Flow123d
JS_before_hm-2115-gf629a871a
|
Go to the documentation of this file.
29 IT::Selection(
"Discrete_output",
"Discrete type of output. Determines type of output data (element, node, native etc).")
36 static const IT::Record &field_output_setting =
37 IT::Record(
"FieldOutputSetting",
"Setting of the field output. The field name, output times, output interpolation (future).")
40 "The field name (from selection).")
42 "Output times specific to particular field.")
44 "Optional value. Implicit value is given by field and can be changed.")
48 "Output of the equation's fields."
49 "The output is done through the output stream of the associated balance law equation."
50 "The stream defines output format for the full space information in selected times and "
51 "observe points for the full time information. The key 'fields' select the fields for the full spatial output."
52 "The set of output times may be specified per field otherwise common time set 'times' is used. If even this is not provided"
53 "the time set of the output_stream is used. The initial time of the equation is automatically added "
54 "to the time set of every selected field. The end time of the equation is automatically added "
55 "to the common output time set.")
58 "Output times used for the output fields without is own time series specification.")
60 "Add all input time points of the equation, mentioned in the 'input_fields' list, also as the output points.")
62 "Array of output fields and their individual output settings.")
64 "Array of the fields evaluated in the observe points of the associated output stream.")
71 :
FieldSet(), output_elem_data_assembly_(nullptr), output_node_data_assembly_(nullptr), output_corner_data_assembly_(nullptr) {
84 const string &additional_description)
86 string selection_name = equation_name +
":OutputFields";
87 string description =
"Selection of output fields for the " + equation_name +
" model.\n" + additional_description;
96 string desc =
"(($[" +
field->
units().format_latex()+
"]$)) "; +
"Output of: the field " +
field->
name() +
" ";
98 desc +=
"Input field: ";
101 sel.
add_value(i,
field->
name(), desc, { {FlowAttribute::field_value_shape(), field->get_value_attribute()} });
115 const string &equation_name,
116 const string &additional_description)
121 param_vec.push_back( std::make_pair(
"output_field_selection", std::make_shared< IT::Selection >(output_field_selection) ) );
136 dh_ = make_shared<DOFHandlerMultiDim>(*
mesh_);
137 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>(
mesh_, fe_p_disc);
138 dh_->distribute_dofs(ds);
144 std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>(
mesh_, fe_p_disc);
157 ASSERT(
stream_).error(
"The 'set_stream' method must be called before the 'read_from_input'.");
161 if (in_rec.
opt_val(
"times", times_array) ) {
165 auto times_array_it =
stream_->get_time_set_array();
166 if (times_array_it) {
173 if (in_rec.
val<
bool>(
"add_input_times")) {
186 auto observe_fields_array = in_rec.
val<
Input::Array>(
"observe_fields");
187 for(
auto it = observe_fields_array.begin<
Input::FullEnum>();
it != observe_fields_array.end(); ++
it) {
194 string field_name =
it -> val< Input::FullEnum >(
"field");
199 if (
it->opt_val(
"interpolation", interpolations)) {
202 interpolation[ *it_interp ] =
true;
209 if (
it->opt_val(
"times", field_times_array)) {
224 for (
uint i_comp=0; i_comp<found_field->
n_comp(); ++i_comp) {
239 auto current_mark_it = marks.current(step,
equation_type_ | marks.type_output() );
240 if (current_mark_it == marks.end(
equation_type_ | marks.type_output()) )
return false;
241 return (field_times_it->second.output_set_.contains(*current_mark_it) );
250 if (step.
end() >
stream_->registered_time()) {
265 used_fields += *(f_acc.field());
268 if (used_fields.size()>0) {
270 mixed_assmbly[1_d]->set_output_data(used_fields,
stream_);
271 mixed_assmbly[2_d]->set_output_data(used_fields,
stream_);
272 mixed_assmbly[3_d]->set_output_data(used_fields,
stream_);
283 used_fields += *(f_acc.field());
286 if (used_fields.size()>0) {
288 mixed_assmbly[1_d]->set_output_data(used_fields,
stream_);
289 mixed_assmbly[2_d]->set_output_data(used_fields,
stream_);
290 mixed_assmbly[3_d]->set_output_data(used_fields,
stream_);
301 used_fields += *(f_acc.field());
304 if (used_fields.size()>0) {
306 mixed_assmbly[1_d]->set_output_data(used_fields,
stream_);
307 mixed_assmbly[2_d]->set_output_data(used_fields,
stream_);
308 mixed_assmbly[3_d]->set_output_data(used_fields,
stream_);
340 if (
stream_->is_output_data_caches_init())
return;
343 bool need_refinment =
stream_->get_output_mesh_record();
346 if(
stream_->enable_refinement()) {
364 WarningOut() <<
"Ignoring output mesh record.\n Output in GMSH format available only on computational mesh!";
388 std::string error_control_field_name =
"";
390 auto it =
stream_->get_output_mesh_record()->find<std::string>(
"error_control_field");
391 if(
it) error_control_field_name = *
it;
393 if(error_control_field_name!=
"")
397 if(
field ==
nullptr){
398 THROW(FieldSet::ExcUnknownField()
399 << FieldCommon::EI_Field(error_control_field_name));
406 DebugOut() <<
"Error control field for output mesh set: " << error_control_field_name <<
".";
407 auto lambda_function =
409 { error_control_field->
value_list(point_list, elm, value_list); };
416 THROW(ExcFieldNotScalar()
417 << FieldCommon::EI_Field(error_control_field_name));
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
EquationOutput()
Default constructor.
const Mesh * mesh() const
Returns pointer to mesh.
virtual void observe_output(std::shared_ptr< Observe > observe)=0
constexpr bool match(Mask mask) const
OutputTime::DiscreteSpace get_output_type() const
double end_time() const
End time.
void initialize(std::shared_ptr< OutputTime > stream, Mesh *mesh, Input::Record in_rec, const TimeGovernor &tg)
Declaration of class which provides the finite element for every mesh cell.
OutputMeshBase::ErrorControlFieldFunc select_error_control_field()
Selects the error control field out of output field set according to input record.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
const Input::Type::Selection & create_output_field_selection(const string &equation_name, const string &additional_description)
TimeMark::Type equation_fixed_mark_type() const
bool is_field_output_time(const FieldCommon &field, TimeStep step) const
void add(double begin, TimeMark::Type mark_type)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
Range< FieldListAccessor > fields_range() const
Returns range of Fields held in field_list.
TimeMarks::iterator end(TimeMark::Type mask) const
Iterator for the end mimics container-like of TimeMarks.
std::shared_ptr< DOFHandlerMultiDim > dh_node_
FieldCommon & flags(FieldFlag::Flags::Mask mask)
static constexpr Mask allow_output
The field can output. Is part of generated output selection. (default on)
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
const Input::Type::Instance & make_output_type(const string &equation_name, const string &aditional_description="")
std::function< void(const Armor::array &, const ElementAccessor< spacedim > &, std::vector< double > &)> ErrorControlFieldFunc
Definitions of basic Lagrangean finite elements with polynomial shape functions.
GenericAssembly< AssemblyOutputNodeData > * output_node_data_assembly_
std::array< bool, 4 > DiscreteSpaceFlags
OutputTimeSet output_set_
Set of output times.
std::vector< FieldCommon * > field_list
List of all fields.
TimeMarks::iterator begin(TimeMark::Type mask) const
Iterator for the begin mimics container-like of TimeMarks.
GenericAssembly< AssemblyOutputNodeData > * output_corner_data_assembly_
static void set_discrete_flag(DiscreteSpaceFlags &dsf, DiscreteSpace d_space)
void read_from_input(Input::Record in_rec, const TimeGovernor &tg)
MixedPtr< DimAssembly, 1 > multidim_assembly() const
Getter to set of assembly objects.
Representation of one time step..
Basic time management functionality for unsteady (and steady) solvers (class Equation).
void add_output_times(double begin, double step, double end)
static DiscreteSpaceFlags empty_discrete_flags()
Check if at least one of discrete space flag is set to true.
std::unordered_map< string, FieldOutputConfig > field_output_times_
Time sets of individual fields.
Common abstract parent of all Field<...> classes.
TimeMark::Type equation_type_
The time mark type of the equation.
static Input::Type::Record & get_input_type()
Container for various descendants of FieldCommonBase.
void read_from_input(Input::Array in_array, const TimeGovernor &tg)
bool is_multifield() const
bool eq(double other_time) const
void output(TimeStep step)
This class is a collection of time marks to manage various events occurring during simulation time.
std::unordered_set< string > observe_fields_
Set of observed fields. The observe points are given within the observe stream.
static const Input::Type::Array get_input_type()
static TimeMarks & marks()
virtual void value_list(const Armor::array &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) const
#define WarningOut()
Macro defining 'warning' record of log.
static constexpr Mask equation_input
The field is data parameter of the owning equation. (default on)
FieldFlag::Flags get_flags() const
const Input::Type::Instance & make_output_type_from_record(Input::Type::Record &in_rec, const string &equation_name, const string &aditional_description="")
TimeMark::Type equation_mark_type() const
Configuration of output of one field. Pair of OutputTimeSet and DiscreteSpaces.
OutputTime::DiscreteSpaceFlags space_flags_
Array of used DiscreteSpaces.
unsigned int n_comp() const
void make_output_mesh(bool parallel)
std::shared_ptr< DOFHandlerMultiDim > dh_
Objects for distribution of dofs.
std::string full_comp_name(unsigned int i_comp) const
std::set< OutputTime::DiscreteSpace > used_interpolations_
OutputTimeSet common_output_times_
The time set used for the fields without explicit time set.
GenericAssembly< AssemblyOutputElemData > * output_elem_data_assembly_
general assembly objects, hold assembly objects of appropriate dimension
FieldCommon & description(const string &description)
Class template representing a field with values dependent on: point, element, and region.
#define DebugOut()
Macro defining 'debug' record of log.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
std::shared_ptr< OutputTime > stream_
output stream (may be shared by more equation)
TimeMark::Type equation_fixed_type_
The fixed time mark type of the equation.
static const unsigned int N_DISCRETE_SPACES
~EquationOutput()
Destructor.
void init_field_item(Input::Iterator< Input::Record > it, const TimeGovernor &tg)
Initialize data of Field given by passed Input::Record.
std::shared_ptr< OutputMeshBase > output_mesh_
Output mesh.
FieldCommon * field(const std::string &field_name) const
FieldCommon & name(const string &name)