diff --git a/include/core/inputFileReader.h b/include/core/inputFileReader.h index 414063e2..08c20e4f 100644 --- a/include/core/inputFileReader.h +++ b/include/core/inputFileReader.h @@ -10,9 +10,9 @@ #include #include - /** - * \brief Input file reader. + * \brief Parameters file reader. Declares parameter names in a dealii parameter_handler + * and parses the file for the values. Variable assignment occurs in userInputParameters. */ class inputFileReader { @@ -28,35 +28,23 @@ class inputFileReader * \brief Method to get a list of entry values from multiple subsections in an input * file. */ - [[nodiscard]] static std::vector - get_subsection_entry_list(const std::string ¶meters_file_name, - const std::string &subsec_name, + [[nodiscard]] std::vector + get_subsection_entry_list(const std::string &subsec_name, const std::string &entry_name, const std::string &default_entry); - /** - * \brief Method to count the number of related entries in an input file. - */ - [[nodiscard]] static unsigned int - get_number_of_entries(const std::string ¶meters_file_name, - const std::string &keyword, - const std::string &entry_name); - /** * \brief Get the trailing part of the entry name after a specified string (used to * extract the model constant names). */ - [[nodiscard]] static std::set - get_entry_name_ending_list(const std::string ¶meters_file_name, - const std::string &keyword, - const std::string &entry_name_begining); + [[nodiscard]] std::set + get_model_constant_names(); /** * \brief Method to declare the parameters to be read from an input file. */ void - declare_parameters(dealii::ParameterHandler ¶meter_handler, - const unsigned int num_of_constants) const; + declare_parameters(); /** * \brief Method to check if a line has the desired contents and if so, extract it. @@ -80,10 +68,88 @@ class inputFileReader static bool check_keyword_match(std::string &line, const std::string &keyword); + /** + * \brief Declare parameters for the mesh. + */ + void + declare_mesh(); + + /** + * \brief Declare parameters for timestepping. + */ + void + declare_time_discretization(); + + /** + * \brief Declare parameters for linear and nonlinear solvers. + */ + void + declare_solver_parameters(); + + /** + * \brief Declare parameters for outputs. + */ + void + declare_output_parameters(); + + /** + * \brief Declare parameters for loading ICs from files. + */ + void + declare_load_IC_parameters(); + + /** + * \brief Declare parameters for checkpoints. + */ + void + declare_checkpoint_parameters(); + + /** + * \brief Declare parameters for boundary conditions. + */ + void + declare_BC_parameters(); + + /** + * \brief Declare parameters for pinned points. + */ + void + declare_pinning_parameters(); + + /** + * \brief Declare parameters for nucleation + */ + void + declare_nucleation_parameters(); + + /** + * \brief Declare parameters for grain remapping. + */ + void + declare_grain_remapping_parameters(); + + /** + * \brief Declare parameters for grain structure loading. + */ + void + declare_grain_loading_parameters(); + + /** + * \brief Declare parameters for user-defined model constants. + */ + void + declare_model_constants(); + + /** + * \brief User defined parameter declarations. + */ + void + declare_user_constants(); + + const std::string parameters_file_name; const AttributesList &var_attributes; const AttributesList &pp_attributes; dealii::ParameterHandler parameter_handler; - unsigned int num_constants; std::set model_constant_names; unsigned int number_of_dimensions; }; diff --git a/include/core/userInputParameters.h b/include/core/userInputParameters.h index 073a2285..fcc2401c 100644 --- a/include/core/userInputParameters.h +++ b/include/core/userInputParameters.h @@ -398,8 +398,8 @@ class userInputParameters const std::vector &userGivenTimeStepList); void - load_user_constants(inputFileReader &input_file_reader, - dealii::ParameterHandler ¶meter_handler); + load_model_constants(inputFileReader &input_file_reader, + dealii::ParameterHandler ¶meter_handler); /** * \brief Compute the number of tensor rows. @@ -438,7 +438,7 @@ class userInputParameters * \brief Assign the primitive user constants (e.g., int, double, bool). */ InputVariant - primitive_user_constant(std::vector &model_constants_strings); + primitive_model_constant(std::vector &model_constants_strings); [[nodiscard]] dealii::Tensor<2, 2 * dim - 1 + dim / 3> get_Cij_tensor(std::vector elastic_constants, diff --git a/src/core/inputFileReader.cc b/src/core/inputFileReader.cc index 0804f9f0..529edcee 100644 --- a/src/core/inputFileReader.cc +++ b/src/core/inputFileReader.cc @@ -8,13 +8,12 @@ inputFileReader::inputFileReader(const std::string &input_file_name, const AttributesList &_var_attributes, const AttributesList &_pp_attributes) - : var_attributes(_var_attributes) + : parameters_file_name(input_file_name) + , var_attributes(_var_attributes) , pp_attributes(_pp_attributes) { - num_constants = get_number_of_entries(input_file_name, "set", "Model constant"); - - model_constant_names = - get_entry_name_ending_list(input_file_name, "set", "Model constant"); + model_constant_names = get_model_constant_names(); + uint num_constants = model_constant_names.size(); if (dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) { @@ -24,8 +23,8 @@ inputFileReader::inputFileReader(const std::string &input_file_name, } // Read in all of the parameters now - declare_parameters(parameter_handler, num_constants); - parameter_handler.parse_input(input_file_name); + declare_parameters(); + parameter_handler.parse_input(parameters_file_name); number_of_dimensions = parameter_handler.get_integer("Number of dimensions"); } @@ -133,8 +132,7 @@ inputFileReader::parse_line(std::string line, // Method to parse an input file to get a list of variables from related // subsections std::vector -inputFileReader::get_subsection_entry_list(const std::string ¶meters_file_name, - const std::string &subsec_name, +inputFileReader::get_subsection_entry_list(const std::string &subsec_name, const std::string &entry_name, const std::string &default_entry) { @@ -206,42 +204,14 @@ inputFileReader::get_subsection_entry_list(const std::string ¶meters_file_na return sorted_entry_list; } -// Method to parse an input file to get a list of variables from related -// subsections -unsigned int -inputFileReader::get_number_of_entries(const std::string ¶meters_file_name, - const std::string &keyword, - const std::string &entry_name) -{ - std::ifstream input_file; - input_file.open(parameters_file_name); - - std::string line; - std::string entry; - bool found_entry = false; - - unsigned int count = 0; - - // Loop through each line - while (std::getline(input_file, line)) - { - found_entry = parse_line(line, keyword, entry_name, entry, false); - if (found_entry) - { - count++; - } - } - return count; -} - // Method to parse an input file to get a list of variables from related // subsections std::set -inputFileReader::get_entry_name_ending_list(const std::string ¶meters_file_name, - const std::string &keyword, - const std::string &entry_name_begining) +inputFileReader::get_model_constant_names() { - std::ifstream input_file; + const std::string keyword = "set"; + const std::string entry_name_begining = "Model constant"; + std::ifstream input_file; input_file.open(parameters_file_name); std::string line; @@ -294,10 +264,27 @@ inputFileReader::get_entry_name_ending_list(const std::string ¶meters_file_n } void -inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, - const unsigned int num_of_constants) const +inputFileReader::declare_parameters() { // Declare all of the entries + declare_mesh(); + declare_time_discretization(); + declare_solver_parameters(); + declare_output_parameters(); + declare_load_IC_parameters(); + declare_checkpoint_parameters(); + declare_BC_parameters(); + declare_pinning_parameters(); + declare_nucleation_parameters(); + declare_grain_remapping_parameters(); + declare_grain_loading_parameters(); + declare_model_constants(); + declare_user_constants(); +} + +void +inputFileReader::declare_mesh() +{ parameter_handler.declare_entry("Number of dimensions", "-1", dealii::Patterns::Integer(), @@ -390,7 +377,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, } parameter_handler.leave_subsection(); } +} +void +inputFileReader::declare_time_discretization() +{ parameter_handler.declare_entry("Number of time steps", "-1", dealii::Patterns::Integer(), @@ -404,7 +395,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, "-0.1", dealii::Patterns::Double(), "The value of simulated time where the simulation ends."); +} +void +inputFileReader::declare_solver_parameters() +{ for (const auto &[index, variable] : var_attributes) { if (variable.eq_type == TIME_INDEPENDENT || @@ -494,7 +489,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, parameter_handler.leave_subsection(); } } +} +void +inputFileReader::declare_output_parameters() +{ parameter_handler.declare_entry("Output file name (base)", "solution", dealii::Patterns::Anything(), @@ -535,8 +534,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, dealii::Patterns::Bool(), "Whether to print the summary table of the wall time and wall time for " "indiviual subroutines every time the code outputs."); +} - // Declare entries for reading initial conditions from file +void +inputFileReader::declare_load_IC_parameters() +{ parameter_handler.declare_entry( "Load initial conditions", "void", @@ -557,8 +559,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, "void", dealii::Patterns::Anything(), "What each variable is named in the file being loaded."); +} - // Checkpoint/restart +void +inputFileReader::declare_checkpoint_parameters() +{ parameter_handler.declare_entry( "Load from a checkpoint", "false", @@ -579,10 +584,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, dealii::Patterns::Integer(), "The number of checkpoints (or number of checkpoints per decade for the " "N_PER_DECADE type)."); +} - /*---------------------- - | Boundary conditions - -----------------------*/ +void +inputFileReader::declare_BC_parameters() +{ for (const auto &[index, variable] : var_attributes) { if (variable.var_type == SCALAR) @@ -625,10 +631,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, "The boundary conditions for one of the governing equations)."); } } +} - /*---------------------- - | Pinning point - -----------------------*/ +void +inputFileReader::declare_pinning_parameters() +{ for (const auto &[index, variable] : var_attributes) { std::string pinning_text = "Pinning point: "; @@ -650,8 +657,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, } parameter_handler.leave_subsection(); } +} - // Declare the nucleation parameters +void +inputFileReader::declare_nucleation_parameters() +{ parameter_handler.declare_entry( "Enable evolution before nucleation", "false", @@ -728,8 +738,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, parameter_handler.leave_subsection(); } } +} - // Declare the grain remapping constants +void +inputFileReader::declare_grain_remapping_parameters() +{ parameter_handler.declare_entry( "Activate grain reassignment", "false", @@ -764,7 +777,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, dealii::Patterns::List(dealii::Patterns::Anything()), "The list of field indices for the shared order parameters for grain " "reassignment."); +} +void +inputFileReader::declare_grain_loading_parameters() +{ parameter_handler.declare_entry("Load grain structure", "false", dealii::Patterns::Bool(), @@ -808,8 +825,11 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, dealii::Patterns::Double(), "The minimum radius for a body to be considered a grain instead of an " "artifact from the loading process."); +} - // Declare the user-defined constants +void +inputFileReader::declare_model_constants() +{ for (const std::string &constant_name : model_constant_names) { std::string constants_text = "Model constant "; @@ -820,3 +840,7 @@ inputFileReader::declare_parameters(dealii::ParameterHandler ¶meter_handler, "The value of a user-defined constant."); } } + +void +inputFileReader::declare_user_constants() +{} diff --git a/src/core/userInputParameters.cc b/src/core/userInputParameters.cc index d69ccd46..cfdd7e22 100644 --- a/src/core/userInputParameters.cc +++ b/src/core/userInputParameters.cc @@ -5,6 +5,227 @@ #include +// NOLINTBEGIN(cppcoreguidelines-pro-type-member-init, hicpp-member-init) +template +userInputParameters::userInputParameters(inputFileReader &input_file_reader, + dealii::ParameterHandler ¶meter_handler) + : var_attributes(input_file_reader.var_attributes) + , pp_attributes(input_file_reader.pp_attributes) +{ + loadVariableAttributes(); + + // Spatial discretization + assign_spatial_discretization_parameters(parameter_handler); + + // Time stepping parameters + assign_temporal_discretization_parameters(parameter_handler); + + // Linear solver parameters + assign_linear_solve_parameters(parameter_handler); + + // Non-linear solver parameters + assign_nonlinear_solve_parameters(parameter_handler); + + // Output parameters + assign_output_parameters(parameter_handler); + + // Initial condition parameters + assign_load_initial_condition_parameters(parameter_handler); + + // Nucleation parameters + assign_nucleation_parameters(parameter_handler); + + // Grain remapping & vtk load-in parameters + assign_grain_parameters(parameter_handler); + + // Boundary conditions + assign_boundary_condition_parameters(parameter_handler); + + // Load the user-defined constants + load_model_constants(input_file_reader, parameter_handler); +} + +// NOLINTEND(cppcoreguidelines-pro-type-member-init, hicpp-member-init) + +template +void +userInputParameters::loadVariableAttributes() +{ + // Load some nucleation parameters + for (const auto &[index, variable] : var_attributes) + { + if (variable.nucleating_variable) + { + nucleating_variable_indices.push_back(index); + } + if (variable.need_value_nucleation || variable.nucleating_variable) + { + nucleation_need_value.push_back(index); + } + } + + nucleation_occurs = !nucleating_variable_indices.empty(); + + // Load variable information for calculating the RHS for explicit equations + num_var_explicit_RHS = 0; + for (const auto &[index, variable] : var_attributes) + { + if (!static_cast(variable.eval_flags_explicit_RHS & + dealii::EvaluationFlags::nothing)) + { + num_var_explicit_RHS++; + } + } + varInfoListExplicitRHS.reserve(num_var_explicit_RHS); + for (const auto &[index, variable] : var_attributes) + { + variable_info varInfo {}; + + varInfo.evaluation_flags = variable.eval_flags_explicit_RHS; + + varInfo.residual_flags = variable.eval_flags_residual_explicit_RHS; + + varInfo.global_var_index = index; + + varInfo.var_needed = + !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); + + varInfo.is_scalar = variable.var_type == SCALAR; + + varInfoListExplicitRHS.push_back(varInfo); + } + + // Load variable information for calculating the RHS for nonexplicit equations + num_var_nonexplicit_RHS = 0; + for (const auto &[index, variable] : var_attributes) + { + if (!static_cast(variable.eval_flags_nonexplicit_RHS & + dealii::EvaluationFlags::nothing)) + { + num_var_nonexplicit_RHS++; + } + } + varInfoListNonexplicitRHS.reserve(num_var_nonexplicit_RHS); + for (const auto &[index, variable] : var_attributes) + { + variable_info varInfo {}; + + varInfo.evaluation_flags = variable.eval_flags_nonexplicit_RHS; + + varInfo.residual_flags = variable.eval_flags_residual_nonexplicit_RHS; + + varInfo.global_var_index = index; + + varInfo.var_needed = + !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); + + varInfo.is_scalar = variable.var_type == SCALAR; + + varInfoListNonexplicitRHS.push_back(varInfo); + } + + // Load variable information for calculating the LHS + num_var_LHS = 0; + for (const auto &[index, variable] : var_attributes) + { + if (!static_cast(variable.eval_flags_nonexplicit_LHS & + dealii::EvaluationFlags::nothing)) + { + num_var_LHS++; + } + } + + varInfoListLHS.reserve(num_var_LHS); + for (const auto &[index, variable] : var_attributes) + { + variable_info varInfo {}; + + varInfo.evaluation_flags = variable.eval_flags_nonexplicit_LHS; + + varInfo.residual_flags = variable.eval_flags_residual_nonexplicit_LHS; + + varInfo.global_var_index = index; + + varInfo.var_needed = + !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); + + varInfo.is_scalar = variable.var_type == SCALAR; + + varInfoListLHS.push_back(varInfo); + } + + varChangeInfoListLHS.reserve(num_var_LHS); + for (const auto &[index, variable] : var_attributes) + { + variable_info varInfo {}; + + varInfo.evaluation_flags = variable.eval_flags_change_nonexplicit_LHS; + + // FOR NOW, TAKING THESE FROM THE VARIABLE ITSELF!! + varInfo.residual_flags = variable.eval_flags_residual_nonexplicit_LHS; + + varInfo.global_var_index = index; + + varInfo.var_needed = + !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); + + varInfo.is_scalar = variable.var_type == SCALAR; + + varChangeInfoListLHS.push_back(varInfo); + } + + // Load variable information for postprocessing + // First, the info list for the base field variables + pp_baseVarInfoList.reserve(var_attributes.size()); + for (const auto &[index, variable] : var_attributes) + { + variable_info varInfo {}; + + varInfo.evaluation_flags = variable.eval_flags_postprocess; + + varInfo.global_var_index = index; + + varInfo.var_needed = + !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); + + varInfo.is_scalar = variable.var_type == SCALAR; + + pp_baseVarInfoList.push_back(varInfo); + } + + // Now load the information for the post-processing variables + // Parameters for postprocessing + + postProcessingRequired = !pp_attributes.empty(); + + num_integrated_fields = 0; + for (const auto &[pp_index, pp_variable] : pp_attributes) + { + if (pp_variable.calc_integral) + { + num_integrated_fields++; + integrated_field_indices.push_back(pp_index); + } + } + + // The info list for the postprocessing field variables + pp_varInfoList.reserve(pp_attributes.size()); + for (const auto &[pp_index, pp_variable] : pp_attributes) + { + variable_info varInfo {}; + + varInfo.var_needed = true; + + varInfo.residual_flags = pp_variable.eval_flags_residual_postprocess; + + varInfo.global_var_index = pp_index; + + varInfo.is_scalar = pp_variable.var_type == SCALAR; + + pp_varInfoList.push_back(varInfo); + } +} + template void userInputParameters::assign_spatial_discretization_parameters( @@ -699,48 +920,6 @@ userInputParameters::assign_boundary_condition_parameters( load_BC_list(list_of_BCs); } -// NOLINTBEGIN(cppcoreguidelines-pro-type-member-init, hicpp-member-init) -template -userInputParameters::userInputParameters(inputFileReader &input_file_reader, - dealii::ParameterHandler ¶meter_handler) - : var_attributes(input_file_reader.var_attributes) - , pp_attributes(input_file_reader.pp_attributes) -{ - loadVariableAttributes(); - - // Spatial discretization - assign_spatial_discretization_parameters(parameter_handler); - - // Time stepping parameters - assign_temporal_discretization_parameters(parameter_handler); - - // Linear solver parameters - assign_linear_solve_parameters(parameter_handler); - - // Non-linear solver parameters - assign_nonlinear_solve_parameters(parameter_handler); - - // Output parameters - assign_output_parameters(parameter_handler); - - // Initial condition parameters - assign_load_initial_condition_parameters(parameter_handler); - - // Nucleation parameters - assign_nucleation_parameters(parameter_handler); - - // Grain remapping & vtk load-in parameters - assign_grain_parameters(parameter_handler); - - // Boundary conditions - assign_boundary_condition_parameters(parameter_handler); - - // Load the user-defined constants - load_user_constants(input_file_reader, parameter_handler); -} - -// NOLINTEND(cppcoreguidelines-pro-type-member-init, hicpp-member-init) - template void userInputParameters::assign_boundary_conditions( @@ -916,185 +1095,6 @@ userInputParameters::setTimeStepList( return timeStepList; } -template -void -userInputParameters::loadVariableAttributes() -{ - // Load some nucleation parameters - for (const auto &[index, variable] : var_attributes) - { - if (variable.nucleating_variable) - { - nucleating_variable_indices.push_back(index); - } - if (variable.need_value_nucleation || variable.nucleating_variable) - { - nucleation_need_value.push_back(index); - } - } - - nucleation_occurs = !nucleating_variable_indices.empty(); - - // Load variable information for calculating the RHS for explicit equations - num_var_explicit_RHS = 0; - for (const auto &[index, variable] : var_attributes) - { - if (!static_cast(variable.eval_flags_explicit_RHS & - dealii::EvaluationFlags::nothing)) - { - num_var_explicit_RHS++; - } - } - varInfoListExplicitRHS.reserve(num_var_explicit_RHS); - for (const auto &[index, variable] : var_attributes) - { - variable_info varInfo {}; - - varInfo.evaluation_flags = variable.eval_flags_explicit_RHS; - - varInfo.residual_flags = variable.eval_flags_residual_explicit_RHS; - - varInfo.global_var_index = index; - - varInfo.var_needed = - !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); - - varInfo.is_scalar = variable.var_type == SCALAR; - - varInfoListExplicitRHS.push_back(varInfo); - } - - // Load variable information for calculating the RHS for nonexplicit equations - num_var_nonexplicit_RHS = 0; - for (const auto &[index, variable] : var_attributes) - { - if (!static_cast(variable.eval_flags_nonexplicit_RHS & - dealii::EvaluationFlags::nothing)) - { - num_var_nonexplicit_RHS++; - } - } - varInfoListNonexplicitRHS.reserve(num_var_nonexplicit_RHS); - for (const auto &[index, variable] : var_attributes) - { - variable_info varInfo {}; - - varInfo.evaluation_flags = variable.eval_flags_nonexplicit_RHS; - - varInfo.residual_flags = variable.eval_flags_residual_nonexplicit_RHS; - - varInfo.global_var_index = index; - - varInfo.var_needed = - !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); - - varInfo.is_scalar = variable.var_type == SCALAR; - - varInfoListNonexplicitRHS.push_back(varInfo); - } - - // Load variable information for calculating the LHS - num_var_LHS = 0; - for (const auto &[index, variable] : var_attributes) - { - if (!static_cast(variable.eval_flags_nonexplicit_LHS & - dealii::EvaluationFlags::nothing)) - { - num_var_LHS++; - } - } - - varInfoListLHS.reserve(num_var_LHS); - for (const auto &[index, variable] : var_attributes) - { - variable_info varInfo {}; - - varInfo.evaluation_flags = variable.eval_flags_nonexplicit_LHS; - - varInfo.residual_flags = variable.eval_flags_residual_nonexplicit_LHS; - - varInfo.global_var_index = index; - - varInfo.var_needed = - !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); - - varInfo.is_scalar = variable.var_type == SCALAR; - - varInfoListLHS.push_back(varInfo); - } - - varChangeInfoListLHS.reserve(num_var_LHS); - for (const auto &[index, variable] : var_attributes) - { - variable_info varInfo {}; - - varInfo.evaluation_flags = variable.eval_flags_change_nonexplicit_LHS; - - // FOR NOW, TAKING THESE FROM THE VARIABLE ITSELF!! - varInfo.residual_flags = variable.eval_flags_residual_nonexplicit_LHS; - - varInfo.global_var_index = index; - - varInfo.var_needed = - !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); - - varInfo.is_scalar = variable.var_type == SCALAR; - - varChangeInfoListLHS.push_back(varInfo); - } - - // Load variable information for postprocessing - // First, the info list for the base field variables - pp_baseVarInfoList.reserve(var_attributes.size()); - for (const auto &[index, variable] : var_attributes) - { - variable_info varInfo {}; - - varInfo.evaluation_flags = variable.eval_flags_postprocess; - - varInfo.global_var_index = index; - - varInfo.var_needed = - !static_cast(varInfo.evaluation_flags & dealii::EvaluationFlags::nothing); - - varInfo.is_scalar = variable.var_type == SCALAR; - - pp_baseVarInfoList.push_back(varInfo); - } - - // Now load the information for the post-processing variables - // Parameters for postprocessing - - postProcessingRequired = !pp_attributes.empty(); - - num_integrated_fields = 0; - for (const auto &[pp_index, pp_variable] : pp_attributes) - { - if (pp_variable.calc_integral) - { - num_integrated_fields++; - integrated_field_indices.push_back(pp_index); - } - } - - // The info list for the postprocessing field variables - pp_varInfoList.reserve(pp_attributes.size()); - for (const auto &[pp_index, pp_variable] : pp_attributes) - { - variable_info varInfo {}; - - varInfo.var_needed = true; - - varInfo.residual_flags = pp_variable.eval_flags_residual_postprocess; - - varInfo.global_var_index = pp_index; - - varInfo.is_scalar = pp_variable.var_type == SCALAR; - - pp_varInfoList.push_back(varInfo); - } -} - template unsigned int userInputParameters::compute_tensor_parentheses( @@ -1219,7 +1219,7 @@ userInputParameters::construct_user_constant( if (model_constants_strings.size() == 2) { - return primitive_user_constant(model_constants_strings); + return primitive_model_constant(model_constants_strings); } else { @@ -1275,7 +1275,7 @@ userInputParameters::construct_user_constant( template InputVariant -userInputParameters::primitive_user_constant( +userInputParameters::primitive_model_constant( std::vector &model_constants_strings) { std::vector model_constants_type_strings = @@ -1308,8 +1308,9 @@ userInputParameters::primitive_user_constant( template void -userInputParameters::load_user_constants(inputFileReader &input_file_reader, - dealii::ParameterHandler ¶meter_handler) +userInputParameters::load_model_constants( + inputFileReader &input_file_reader, + dealii::ParameterHandler ¶meter_handler) { for (const std::string &constant_name : input_file_reader.model_constant_names) {