From 6c9248bc7a142c9f17edf7ea85d4f1da17546404 Mon Sep 17 00:00:00 2001 From: Sebastian Schunert Date: Fri, 26 Feb 2016 17:39:08 -0700 Subject: [PATCH] Adding parsing for double indexed capabilities (#6442) --- .../include/actions/GlobalParamsAction.h | 8 + framework/include/parser/Parser.h | 5 + framework/include/utils/MooseUtils.h | 22 + framework/src/parser/Parser.C | 144 +++++++ test/include/userobjects/ReadDoubleIndex.h | 67 +++ test/src/base/MooseTestApp.C | 2 + test/src/userobjects/ReadDoubleIndex.C | 399 ++++++++++++++++++ .../gold/parse_double_index.e | Bin 0 -> 30564 bytes .../parse_double_index/parse_double_index.i | 79 ++++ test/tests/parser/parse_double_index/tests | 7 + 10 files changed, 733 insertions(+) create mode 100644 test/include/userobjects/ReadDoubleIndex.h create mode 100644 test/src/userobjects/ReadDoubleIndex.C create mode 100644 test/tests/parser/parse_double_index/gold/parse_double_index.e create mode 100644 test/tests/parser/parse_double_index/parse_double_index.i create mode 100644 test/tests/parser/parse_double_index/tests diff --git a/framework/include/actions/GlobalParamsAction.h b/framework/include/actions/GlobalParamsAction.h index ebac19de136d..6a5a95f4fc8d 100644 --- a/framework/include/actions/GlobalParamsAction.h +++ b/framework/include/actions/GlobalParamsAction.h @@ -50,5 +50,13 @@ class GlobalParamsAction: public Action { return parameters().set >(name); } + + template + inline + std::vector > & setDoubleIndexParam(const std::string &name) + { + return parameters().set > >(name); + } + }; #endif //GLOBALPARAMSACTION_H diff --git a/framework/include/parser/Parser.h b/framework/include/parser/Parser.h index d1529df1af9d..52742c98b90d 100644 --- a/framework/include/parser/Parser.h +++ b/framework/include/parser/Parser.h @@ -137,6 +137,11 @@ class Parser : public ConsoleStreamInterface void setVectorParameter(const std::string & full_name, const std::string & short_name, InputParameters::Parameter >* param, bool in_global, GlobalParamsAction * global_block); + /// Template method for setting any double indexed type parameter read from the input file or command line + template + void setDoubleIndexParameter(const std::string & full_name, const std::string & short_name, + InputParameters::Parameter > >* param, bool in_global, GlobalParamsAction * global_block); + /// Template method for setting any multivalue "scalar" type parameter read from the input file or command line. Examples include "Point" and "RealVectorValue" template void setScalarComponentParameter(const std::string & full_name, const std::string & short_name, diff --git a/framework/include/utils/MooseUtils.h b/framework/include/utils/MooseUtils.h index 481634922eed..4d1b33fc044f 100644 --- a/framework/include/utils/MooseUtils.h +++ b/framework/include/utils/MooseUtils.h @@ -276,6 +276,28 @@ namespace MooseUtils pos = str.find_first_of(delims, std::min(last_pos + min_len, str.size())); } } + + /** + * tokenizeAndConvert splits a string using delimiter and then converts to type T. + * If the conversion fails tokenizeAndConvert returns false, otherwise true. + */ + template + bool + tokenizeAndConvert(const std::string & str, std::vector & tokenized_vector, const std::string & delimiter = " \t\n\v\f\r") + { + std::vector tokens; + MooseUtils::tokenize(str, tokens, 1, delimiter); + tokenized_vector.resize(tokens.size()); + for (unsigned int j = 0; j < tokens.size(); ++j) + { + std::stringstream ss(tokens[j]); + // we have to make sure that the conversion succeeded _and_ that the string + // was fully read to avoid situations like [conversion to Real] 3.0abc to work + if ((ss >> tokenized_vector[j]).fail() || !ss.eof()) + return false; + } + return true; + } } #endif //MOOSEUTILS_H diff --git a/framework/src/parser/Parser.C b/framework/src/parser/Parser.C index a70f8b4b9a63..1ebed91877de 100644 --- a/framework/src/parser/Parser.C +++ b/framework/src/parser/Parser.C @@ -649,6 +649,9 @@ template<> void Parser::setVectorParameter(const std::string & full_name, const std::string & short_name, InputParameters::Parameter > * param, bool in_global, GlobalParamsAction * global_block); +template<> +void Parser::setDoubleIndexParameter(const std::string & full_name, const std::string & short_name, + InputParameters::Parameter > >* param, bool /*in_global*/, GlobalParamsAction * /*global_block*/); // Macros for parameter extraction #define dynamicCastAndExtractScalar(type, param, full_name, short_name, in_global, global_block) \ @@ -675,6 +678,14 @@ void Parser::setVectorParameter(const std::string & full_name, con setVectorParameter(full_name, short_name, vector_p, in_global, global_block); \ } while (0) +#define dynamicCastAndExtractDoubleIndex(type, param, full_name, short_name, in_global, global_block) \ + do \ + { \ + InputParameters::Parameter > > * double_index_p = dynamic_cast > > *>(param); \ + if (double_index_p) \ + setDoubleIndexParameter(full_name, short_name, double_index_p, in_global, global_block); \ + } while (0) + void Parser::extractParams(const std::string & prefix, InputParameters &p) { @@ -832,6 +843,43 @@ Parser::extractParams(const std::string & prefix, InputParameters &p) dynamicCastAndExtractVector(VectorPostprocessorName, it->second, full_name, it->first, in_global, global_params_block); dynamicCastAndExtractVector(OutputName , it->second, full_name, it->first, in_global, global_params_block); dynamicCastAndExtractVector(MaterialPropertyName , it->second, full_name, it->first, in_global, global_params_block); + + /** + * Double indexed types + */ + // built-ins + dynamicCastAndExtractDoubleIndex(Real , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(int , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(long , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(unsigned int , it->second, full_name, it->first, in_global, global_params_block); + // See vector type explanation + #if LIBMESH_DOF_ID_BYTES == 8 + dynamicCastAndExtractDoubleIndex(uint64_t , it->second, full_name, it->first, in_global, global_params_block); + #endif + + dynamicCastAndExtractDoubleIndex(SubdomainID , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(BoundaryID , it->second, full_name, it->first, in_global, global_params_block); + + // Moose String-derived vectors + dynamicCastAndExtractDoubleIndex(/*std::*/string , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(FileName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(FileNameNoExtension , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(MeshFileName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(SubdomainName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(BoundaryName , it->second, full_name, it->first, in_global, global_params_block); + // these are problematic because Coupleable inherently assumes this is a vector. + //dynamicCastAndExtractDoubleIndex(VariableName , it->second, full_name, it->first, in_global, global_params_block); + //dynamicCastAndExtractDoubleIndex(NonlinearVariableName , it->second, full_name, it->first, in_global, global_params_block); + //dynamicCastAndExtractDoubleIndex(AuxVariableName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(FunctionName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(UserObjectName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(IndicatorName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(MarkerName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(MultiAppName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(PostprocessorName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(VectorPostprocessorName, it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(OutputName , it->second, full_name, it->first, in_global, global_params_block); + dynamicCastAndExtractDoubleIndex(MaterialPropertyName , it->second, full_name, it->first, in_global, global_params_block); } } @@ -929,6 +977,45 @@ void Parser::setVectorParameter(const std::string & full_name, const std::string } } + +template +void Parser::setDoubleIndexParameter(const std::string & full_name, const std::string & short_name, InputParameters::Parameter > >* param, bool in_global, GlobalParamsAction * global_block) +{ + GetPot *gp; + + // See if this variable was passed on the command line + // if it was then we will retrieve the value from the command line instead of the file + if (_app.commandLine() && _app.commandLine()->haveVariable(full_name.c_str())) + gp = _app.commandLine()->getPot(); + else + gp = &_getpot_file; + + // Get the full string assigned to the variable full_name + std::string buffer = gp->get_value_no_default(full_name, ""); + + // split vector at delim ; + // NOTE: the substrings are _not_ of type T yet + std::vector first_tokenized_vector; + MooseUtils::tokenize(buffer, first_tokenized_vector, 1, ";"); + param->set().resize(first_tokenized_vector.size()); + + for (unsigned j = 0; j < first_tokenized_vector.size(); ++j) + if (!MooseUtils::tokenizeAndConvert(first_tokenized_vector[j], param->set()[j])) + mooseError("Reading parameter " << short_name << " failed."); + + if (in_global) + { + global_block->remove(short_name); + global_block->setDoubleIndexParam(short_name).resize(first_tokenized_vector.size()); + for (unsigned j = 0; j < first_tokenized_vector.size(); ++j) + { + global_block->setDoubleIndexParam(short_name)[j].resize(param->get()[j].size()); + for (unsigned int i = 0; i < param->get()[j].size(); ++i) + global_block->setDoubleIndexParam(short_name)[j][i] = param->get()[j][i]; + } + } +} + template void Parser::setScalarComponentParameter(const std::string & full_name, const std::string & short_name, InputParameters::Parameter * param, bool in_global, GlobalParamsAction * global_block) { @@ -1202,6 +1289,8 @@ void Parser::setVectorParameter(const std::string & full_name, con // If we are able to convert this value into a Real, then set a default coupled value if (ss >> real_value && ss.eof()) + // FIXME: the real_value is assigned to defaultCoupledValue overriding the value assigned before. + // Currently there is no functionality to separately assign the correct "real_value[i]" in InputParameters _current_params->defaultCoupledValue(short_name, real_value); else { @@ -1221,3 +1310,58 @@ void Parser::setVectorParameter(const std::string & full_name, con param->set()[i] = var_names[i]; } } + +// Specialization for coupling double index objects. This routine handles default values and auto generated VariableValue vectors +// Problematic because Coupleable assumes that coupled variables come as a vector. This would require changes in Coupleable and probably elsewhere. +/* +template<> +void Parser::setDoubleIndexParameter(const std::string & full_name, const std::string & short_name, InputParameters::Parameter > >* param, bool in_global, GlobalParamsAction * global_block) +{ + GetPot *gp; + + // See if this variable was passed on the command line + // if it was then we will retrieve the value from the command line instead of the file + if (_app.commandLine() && _app.commandLine()->haveVariable(full_name.c_str())) + gp = _app.commandLine()->getPot(); + else + gp = &_getpot_file; + + // Get the full string assigned to the variable full_name + std::string buffer = gp->get_value_no_default(full_name, ""); + + // split vector at delim ; + // NOTE: the substrings are _not_ of type T yet + std::vector first_tokenized_vector; + MooseUtils::tokenize(buffer, first_tokenized_vector, 1, ";"); + + // Check if all entries can be converted to Real -> default case + std::vector > default_reals; + bool success = true; + default_reals.resize(first_tokenized_vector.size()); + for (unsigned j = 0; j < first_tokenized_vector.size(); ++j) + if (!MooseUtils::tokenizeAndConvert(first_tokenized_vector[j], default_reals[j])) + { + success = false; + break; + } + + if (success) + { + // the conversion to Real was successful for all elements. Set default values + // and leave function + for (unsigned j = 0; j < default_reals.size(); ++j) + for (unsigned int i = 0; i < default_reals[j].size(); ++i) + // FIXME: the real_value is assigned to defaultCoupledValue overriding the value assigned before. + // Currently there is no functionality to separately assign the correct "real_value[i]" in InputParameters + _current_params->defaultCoupledValue(short_name, default_reals[j][i]); + return; + } + + // Conversion to Real failed for at least one element so we assume that all elements are + // of type VariableName. If not error out. + param->set().resize(first_tokenized_vector.size()); + for (unsigned j = 0; j < first_tokenized_vector.size(); ++j) + if (!MooseUtils::tokenizeAndConvert(first_tokenized_vector[j], param->set()[j])) + mooseError("Reading parameter " << short_name << " failed. This can occur if VariableName and Reals (defaults) are mixed. Moose does not support this."); +} +*/ diff --git a/test/include/userobjects/ReadDoubleIndex.h b/test/include/userobjects/ReadDoubleIndex.h new file mode 100644 index 000000000000..72ba20094e4c --- /dev/null +++ b/test/include/userobjects/ReadDoubleIndex.h @@ -0,0 +1,67 @@ +/****************************************************************/ +/* DO NOT MODIFY THIS HEADER */ +/* MOOSE - Multiphysics Object Oriented Simulation Environment */ +/* */ +/* (c) 2010 Battelle Energy Alliance, LLC */ +/* ALL RIGHTS RESERVED */ +/* */ +/* Prepared by Battelle Energy Alliance, LLC */ +/* Under Contract No. DE-AC07-05ID14517 */ +/* With the U. S. Department of Energy */ +/* */ +/* See COPYRIGHT for full restrictions */ +/****************************************************************/ + +#ifndef READDOUBLEINDEX_H +#define READDOUBLEINDEX_H + +#include "GeneralUserObject.h" + +class ReadDoubleIndex; + +template<> +InputParameters validParams(); + + +/** + * User Object for testing double index parsing + */ +class ReadDoubleIndex : public GeneralUserObject +{ +public: + ReadDoubleIndex(const InputParameters & params); + + virtual void initialize() {}; + virtual void execute(); + virtual void finalize() {}; + +protected: + const std::vector > & _real_di; + const std::vector > & _uint_di; + const std::vector > & _int_di; + const std::vector > & _long_di; + const std::vector > & _subid_di; + const std::vector > & _bid_di; + + const std::vector > & _str_di; + const std::vector > & _file_di; + const std::vector > & _file_no_di; + + const std::vector > & _mesh_file_di; + const std::vector > & _subdomain_name_di; + const std::vector > & _boundary_name_di; + const std::vector > & _function_name_di; + const std::vector > & _userobject_name_di; + const std::vector > & _indicator_name_di; + + const std::vector > & _marker_name_di; + const std::vector > & _multiapp_name_di; + const std::vector > & _postprocessor_name_di; + const std::vector > & _vector_postprocessor_name_di; + const std::vector > & _output_name_di; + const std::vector > & _material_property_name_di; + +}; + + +#endif /* ReadDoubleIndex_H */ diff --git a/test/src/base/MooseTestApp.C b/test/src/base/MooseTestApp.C index 7cf90195150c..787acde9096a 100644 --- a/test/src/base/MooseTestApp.C +++ b/test/src/base/MooseTestApp.C @@ -174,6 +174,7 @@ #include "TestBoundaryRestrictableAssert.h" #include "GetMaterialPropertyBoundaryBlockNamesTest.h" #include "SetupInterfaceCount.h" +#include "ReadDoubleIndex.h" // Postprocessors #include "TestCopyInitialSolution.h" @@ -461,6 +462,7 @@ MooseTestApp::registerObjects(Factory & factory) registerUserObject(SideSetupInterfaceCount); registerUserObject(InternalSideSetupInterfaceCount); registerUserObject(NodalSetupInterfaceCount); + registerUserObject(ReadDoubleIndex); registerPostprocessor(InsideValuePPS); registerPostprocessor(TestCopyInitialSolution); diff --git a/test/src/userobjects/ReadDoubleIndex.C b/test/src/userobjects/ReadDoubleIndex.C new file mode 100644 index 000000000000..54de206fd2c9 --- /dev/null +++ b/test/src/userobjects/ReadDoubleIndex.C @@ -0,0 +1,399 @@ +/****************************************************************/ +/* DO NOT MODIFY THIS HEADER */ +/* MOOSE - Multiphysics Object Oriented Simulation Environment */ +/* */ +/* (c) 2010 Battelle Energy Alliance, LLC */ +/* ALL RIGHTS RESERVED */ +/* */ +/* Prepared by Battelle Energy Alliance, LLC */ +/* Under Contract No. DE-AC07-05ID14517 */ +/* With the U. S. Department of Energy */ +/* */ +/* See COPYRIGHT for full restrictions */ +/****************************************************************/ + +#include "ReadDoubleIndex.h" +#include + +template<> +InputParameters validParams() +{ + InputParameters params = validParams(); + params.addRequiredParam > >("real_di", "A double index field of real numbers."); + params.addRequiredParam > >("uint_di", "A double index field of unsigned integers."); + params.addRequiredParam > >("int_di", "A double index field of integers."); + params.addRequiredParam > >("long_di", "A double index field of long integers."); + params.addRequiredParam > >("subid_di", "A double index field of SubdomainID."); + params.addRequiredParam > >("bid_di", "A double index field of SubdomainID."); + params.addRequiredParam > >("str_di", "A double index field of std::string."); + params.addRequiredParam > >("file_di", "A double index field of FileName."); + params.addRequiredParam > >("file_no_di", "A double index field of FileNameNoExtension."); + params.addRequiredParam > >("mesh_file_di", "A double index field of MeshFileName."); + params.addRequiredParam > >("subdomain_name_di", "A double index field of SubdomainName."); + params.addRequiredParam > >("boundary_name_di", "A double index field of BoundaryName."); + params.addRequiredParam > >("function_name_di", "A double index field of FunctionName."); + params.addRequiredParam > >("userobject_name_di", "A double index field of UserObjectName."); + params.addRequiredParam > >("indicator_name_di", "A double index field of IndicatorName."); + params.addRequiredParam > >("marker_name_di", "A double index field of MarkerName."); + params.addRequiredParam > >("multiapp_name_di", "A double index field of MultiAppName."); + params.addRequiredParam > >("postprocessor_name_di", "A double index field of PostprocessorName."); + params.addRequiredParam > >("vector_postprocessor_name_di", "A double index field of VectorPostprocessorName."); + params.addRequiredParam > >("output_name_di", "A double index field of OutputName."); + params.addRequiredParam > >("material_property_name_di", "A double index field of MaterialPropertyName."); + return params; +} + + +ReadDoubleIndex::ReadDoubleIndex(const InputParameters & params) : + GeneralUserObject(params), + _real_di(getParam > >("real_di")), + _uint_di(getParam > >("uint_di")), + _int_di(getParam > >("int_di")), + _long_di(getParam > >("long_di")), + _subid_di(getParam > >("subid_di")), + _bid_di(getParam > >("bid_di")), + _str_di(getParam > >("str_di")), + _file_di(getParam > >("file_di")), + _file_no_di(getParam > >("file_no_di")), + _mesh_file_di(getParam > >("mesh_file_di")), + _subdomain_name_di(getParam > >("subdomain_name_di")), + _boundary_name_di(getParam > >("boundary_name_di")), + _function_name_di(getParam > >("function_name_di")), + _userobject_name_di(getParam > >("userobject_name_di")), + _indicator_name_di(getParam > >("indicator_name_di")), + _marker_name_di(getParam > >("marker_name_di")), + _multiapp_name_di(getParam > >("multiapp_name_di")), + _postprocessor_name_di(getParam > >("postprocessor_name_di")), + _vector_postprocessor_name_di(getParam > >("vector_postprocessor_name_di")), + _output_name_di(getParam > >("output_name_di")), + _material_property_name_di(getParam > >("material_property_name_di")) +{ + std::vector array_length; + array_length.resize(3); + array_length[0] = 1; + array_length[1] = 3; + array_length[2] = 2; + + // check real + if (_real_di.size() != 3) + mooseError("Error reading real_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_real_di[j].size() != array_length[j]) + mooseError("Error reading real_di."); + for (unsigned int i = 0; i < _real_di[j].size(); ++i) + if (!MooseUtils::absoluteFuzzyEqual(_real_di[j][i], (j + 1.0) + 0.1 * (i + 1))) + mooseError("Error reading real_di."); + } + + // check unsigned int + if (_uint_di.size() != 3) + mooseError("Error reading uint_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_uint_di[j].size() != array_length[j]) + mooseError("Error reading uint_di."); + for (unsigned int i = 0; i < _uint_di[j].size(); ++i) + if (_uint_di[j][i] != (j + 1) * 10 + i + 1) + mooseError("Error reading uint_di."); + } + + // check int + if (_int_di.size() != 3) + mooseError("Error reading int_di."); + for (int j = 0; j < 3; ++j) + { + if (_int_di[j].size() != array_length[j]) + mooseError("Error reading int_di."); + for (int i = 0; i < _int_di[j].size(); ++i) + { + int mult = ((j == 1) ? -1 : 1); + if (_int_di[j][i] != mult * ((j + 1) * 10 + i + 1)) + mooseError("Error reading int_di."); + } + } + + // check long + if (_long_di.size() != 3) + mooseError("Error reading long_di."); + for (long j = 0; j < 3; ++j) + { + if (_long_di[j].size() != array_length[j]) + mooseError("Error reading long_di."); + for (long i = 0; i < _long_di[j].size(); ++i) + { + long mult = ((j != 1) ? -1 : 1); + if (_long_di[j][i] != mult * ((j + 1) * 10 + i + 1)) + mooseError("Error reading long_di."); + } + } + + // check SubdomainID + if (_subid_di.size() != 3) + mooseError("Error reading subid_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_subid_di[j].size() != array_length[j]) + mooseError("Error reading subid_di."); + for (unsigned int i = 0; i < _subid_di[j].size(); ++i) + if (_subid_di[j][i] != (j + 2) * 10 + i + 2) + mooseError("Error reading subid_di."); + } + + // check BoundaryID + if (_bid_di.size() != 3) + mooseError("Error reading bid_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_bid_di[j].size() != array_length[j]) + mooseError("Error reading bid_di."); + for (unsigned int i = 0; i < _bid_di[j].size(); ++i) + if (_bid_di[j][i] != (j + 2) * 10 + i + 1) + mooseError("Error reading bid_di."); + } + + // check std::string + if (_str_di.size() != 3) + mooseError("Error reading str_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_str_di[j].size() != array_length[j]) + mooseError("Error reading str_di."); + for (unsigned int i = 0; i < _str_di[j].size(); ++i) + { + std::stringstream ss; + ss << "string" << j << i; + if (_str_di[j][i] != ss.str()) + mooseError("Error reading str_di."); + } + } + + // check FileName + if (_file_di.size() != 3) + mooseError("Error reading file_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_file_di[j].size() != array_length[j]) + mooseError("Error reading file_di."); + for (unsigned int i = 0; i < _file_di[j].size(); ++i) + { + std::stringstream ss; + ss << "file" << j << i; + if (_file_di[j][i] != ss.str()) + mooseError("Error reading file_di."); + } + } + + // check FileNameNoExtension + if (_file_no_di.size() != 3) + mooseError("Error reading file_no_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_file_no_di[j].size() != array_length[j]) + mooseError("Error reading file_no_di."); + for (unsigned int i = 0; i < _file_no_di[j].size(); ++i) + { + std::stringstream ss; + ss << "file_no" << j << i; + if (_file_no_di[j][i] != ss.str()) + mooseError("Error reading file_no_di."); + } + } + + // check MeshFileName + if (_mesh_file_di.size() != 3) + mooseError("Error reading mesh_file_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_mesh_file_di[j].size() != array_length[j]) + mooseError("Error reading mesh_file_di."); + for (unsigned int i = 0; i < _mesh_file_di[j].size(); ++i) + { + std::stringstream ss; + ss << "mesh_file" << j << i; + if (_mesh_file_di[j][i] != ss.str()) + mooseError("Error reading mesh_file_di."); + } + } + + // check SubdomainName + if (_subdomain_name_di.size() != 3) + mooseError("Error reading subdomain_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_subdomain_name_di[j].size() != array_length[j]) + mooseError("Error reading subdomain_name_di."); + for (unsigned int i = 0; i < _subdomain_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "subdomain_name" << j << i; + if (_subdomain_name_di[j][i] != ss.str()) + mooseError("Error reading subdomain_name_di."); + } + } + + // check BoundaryName + if (_boundary_name_di.size() != 3) + mooseError("Error reading boundary_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_boundary_name_di[j].size() != array_length[j]) + mooseError("Error reading boundary_name_di."); + for (unsigned int i = 0; i < _boundary_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "boundary_name" << j << i; + if (_boundary_name_di[j][i] != ss.str()) + mooseError("Error reading boundary_name_di."); + } + } + + // check FunctionName + if (_function_name_di.size() != 3) + mooseError("Error reading function_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_function_name_di[j].size() != array_length[j]) + mooseError("Error reading function_name_di."); + for (unsigned int i = 0; i < _function_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "function_name" << j << i; + if (_function_name_di[j][i] != ss.str()) + mooseError("Error reading function_name_di."); + } + } + + // check UserObjectName + if (_userobject_name_di.size() != 3) + mooseError("Error reading userobject_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_userobject_name_di[j].size() != array_length[j]) + mooseError("Error reading userobject_name_di."); + for (unsigned int i = 0; i < _userobject_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "userobject_name" << j << i; + if (_userobject_name_di[j][i] != ss.str()) + mooseError("Error reading userobject_name_di."); + } + } + + // check IndicatorName + if (_indicator_name_di.size() != 3) + mooseError("Error reading indicator_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_indicator_name_di[j].size() != array_length[j]) + mooseError("Error reading indicator_name_di."); + for (unsigned int i = 0; i < _indicator_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "indicator_name" << j << i; + if (_indicator_name_di[j][i] != ss.str()) + mooseError("Error reading indicator_name_di."); + } + } + + // check MarkerName + if (_marker_name_di.size() != 3) + mooseError("Error reading marker_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_marker_name_di[j].size() != array_length[j]) + mooseError("Error reading marker_name_di."); + for (unsigned int i = 0; i < _marker_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "marker_name" << j << i; + if (_marker_name_di[j][i] != ss.str()) + mooseError("Error reading marker_name_di."); + } + } + + // check MultiAppName + if (_multiapp_name_di.size() != 3) + mooseError("Error reading multiapp_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_multiapp_name_di[j].size() != array_length[j]) + mooseError("Error reading multiapp_name_di."); + for (unsigned int i = 0; i < _multiapp_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "multiapp_name" << j << i; + if (_multiapp_name_di[j][i] != ss.str()) + mooseError("Error reading multiapp_name_di."); + } + } + + // check PostprocessorName + if (_postprocessor_name_di.size() != 3) + mooseError("Error reading postprocessor_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_postprocessor_name_di[j].size() != array_length[j]) + mooseError("Error reading postprocessor_name_di."); + for (unsigned int i = 0; i < _postprocessor_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "postprocessor_name" << j << i; + if (_postprocessor_name_di[j][i] != ss.str()) + mooseError("Error reading postprocessor_name_di."); + } + } + + // check VectorPostprocessorName + if (_vector_postprocessor_name_di.size() != 3) + mooseError("Error reading vector_postprocessor_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_vector_postprocessor_name_di[j].size() != array_length[j]) + mooseError("Error reading vector_postprocessor_name_di."); + for (unsigned int i = 0; i < _vector_postprocessor_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "vector_postprocessor_name" << j << i; + if (_vector_postprocessor_name_di[j][i] != ss.str()) + mooseError("Error reading vector_postprocessor_name_di."); + } + } + + // check OutputName + if (_output_name_di.size() != 3) + mooseError("Error reading output_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_output_name_di[j].size() != array_length[j]) + mooseError("Error reading output_name_di."); + for (unsigned int i = 0; i < _output_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "output_name" << j << i; + if (_output_name_di[j][i] != ss.str()) + mooseError("Error reading output_name_di."); + } + } + + // check MaterialPropertyName + if (_material_property_name_di.size() != 3) + mooseError("Error reading material_property_name_di."); + for (unsigned int j = 0; j < 3; ++j) + { + if (_material_property_name_di[j].size() != array_length[j]) + mooseError("Error reading material_property_name_di."); + for (unsigned int i = 0; i < _material_property_name_di[j].size(); ++i) + { + std::stringstream ss; + ss << "material_property_name" << j << i; + if (_material_property_name_di[j][i] != ss.str()) + mooseError("Error reading material_property_name_di."); + } + } +} + +void +ReadDoubleIndex::execute() +{ +} diff --git a/test/tests/parser/parse_double_index/gold/parse_double_index.e b/test/tests/parser/parse_double_index/gold/parse_double_index.e new file mode 100644 index 0000000000000000000000000000000000000000..1dd73a89492ab721bd31757d5bd0622d9bc879c7 GIT binary patch literal 30564 zcmeHQdyE^$eWv`7PY=KC#IYr3Z21+(cRKP;cC47bJLyjHSx-wRzm#OXB$szuYAV5>JKnL^O{wwhgGnal>@a&w+lcN+R!+936Hw*)&P`YSYt>yai)8p(a7 z=CNu{fNRPG@@%DE@zkkgorHC{7~NEiZd&WMnCp0wF0%#tkdAbnI?{FONEg+u+N^$A zC$ipLuk7RSV(7L4mjPSsnrp2(LEZH|9A+*BHq8Fs<~-ud67)BeE56-8%UdKWu|BU{l$xpsrOyD2?e`apJwx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