std::vector<ExecFlagType> vectorStringsToEnum<ExecFlagType>(const MultiMooseEnum & v) { std::vector<ExecFlagType> exec_flags(v.size()); for (unsigned int i=0; i<v.size(); ++i) exec_flags[i] = stringToEnum<ExecFlagType>(v[i]); return exec_flags; }
void RankTwoScalarAction::act() { std::vector<MaterialPropertyName> tensors = getParam<std::vector<MaterialPropertyName> >("rank_two_tensor"); const MultiMooseEnum scalar_types = getParam<MultiMooseEnum>("scalar_type"); for (unsigned int i = 0; i < tensors.size(); i++) { for (int j = 0; j < LIBMESH_DIM; j++) { for (int k = 0; k < LIBMESH_DIM; k++) { InputParameters pp_params = _factory.getValidParams("MaterialTensorIntegral"); pp_params.set<MaterialPropertyName>("rank_two_tensor") = tensors[ i ]; pp_params.set<unsigned int>("index_i") = j; pp_params.set<unsigned int>("index_j") = k; pp_params.set<std::vector<OutputName> >("outputs") = { "none" }; if (isParamValid("block")) { pp_params.set<std::vector<SubdomainName> >("block") = getParam<std::vector<SubdomainName> >("block"); } _problem->addPostprocessor( "MaterialTensorIntegral", std::string(tensors[ i ]) + std::to_string(j) + std::to_string(k), pp_params); } } for (unsigned int j = 0; j < scalar_types.size(); j++) { InputParameters pp_params = _factory.getValidParams("RankTwoScalarPostprocessor"); for (int j = 0; j < LIBMESH_DIM; j++) { for (int k = 0; k < LIBMESH_DIM; k++) { pp_params.set<PostprocessorName>(std::string("index") + std::to_string(j) + std::to_string(k)) = std::string(tensors[ i ]) + std::to_string(j) + std::to_string(k); } } pp_params.set<MooseEnum>("scalar_type") = scalar_types[ j ]; _problem->addPostprocessor("RankTwoScalarPostprocessor", std::string(tensors[ i ]) + std::string("_") + std::string(scalar_types[ j ]), pp_params); } } // InputParameters pp_params = _factory.getValidParams("VolumePostprocessor"); // if (isParamValid("block")) // { // pp_params.set<std::vector<SubdomainName> >("block") = getParam<std::vector<SubdomainName> >("block"); // } // _problem->addPostprocessor("VolumePostprocessor", "Volume", pp_params); }
bool MultiMooseEnum::operator==(const MultiMooseEnum & value) const { // Not the same if the lengths are different if (value.size() != size()) return false; // Return false if this enum does not contain an item from the other for (const auto & me : value) if (!contains(me)) return false; // If you get here, they must be the same return true; }
bool MultiMooseEnum::operator==(const MultiMooseEnum & value) const { // Not the same if the lengths are different if (value.size() != size()) return false; // Return false if this enum does not contain an item from the other for (MooseEnumIterator it = value.begin(); it != value.end(); ++it) if (!contains(*it)) return false; // If you get here, they must be the same return true; }