diff --git a/include/actions/RedbackMechAction.h b/include/actions/RedbackMechAction.h index 688fccfc..97466bc4 100644 --- a/include/actions/RedbackMechAction.h +++ b/include/actions/RedbackMechAction.h @@ -35,6 +35,8 @@ class RedbackMechAction : public Action protected: /// if this vector is not empty the variables, kernels and materials are restricted to these subdomains std::vector _subdomain_names; + /// indicates, if the vector of subdomain names is set (dont set block restrictions, if not) + const bool _subdomain_names_set; }; #endif // REDBACKMECHACTION_H diff --git a/src/actions/RedbackMechAction.C b/src/actions/RedbackMechAction.C index c081687f..8700675c 100644 --- a/src/actions/RedbackMechAction.C +++ b/src/actions/RedbackMechAction.C @@ -31,7 +31,7 @@ RedbackMechAction::validParams() params.addParam( "appended_property_name", "", "Name appended to material properties to make them unique"); params.addParam>( - "block", + "block",{}, "The list of ids of the blocks (subdomain) that the mechanics kernels will be applied to"); // changed this from true to false @@ -47,7 +47,8 @@ RedbackMechAction::RedbackMechAction(const InputParameters & params) _disp_r(getParam("disp_r")), _temp(getParam("temp")), _pore_pres(getParam("pore_pres")), - _subdomain_names(getParam>("block")) + _subdomain_names(getParam>("block")), + _subdomain_names_set(isParamSetByUser("block")) { } @@ -132,6 +133,22 @@ RedbackMechAction::act() name << short_name; name << i; + // // get subdomain IDs + // std::set _subdomain_ids; + // for (auto & name : _subdomain_names) + // { + // auto id = _mesh->getSubdomainID(name); + // if (id == Moose::INVALID_BLOCK_ID) + // paramError("block", "Subdomain \"" + name + "\" not found in mesh."); + // else + // _subdomain_ids.insert(id); + // } + // + // // Make sure that all mesh subdomains have the same coordinate system + // const auto & all_subdomains = + // _subdomain_names.empty() ? _problem->mesh().meshSubdomains() : _subdomain_ids; + // if (_subdomain_names_set) + // params.set>("block") = _subdomain_names; params.set>("block") = _subdomain_names; params.set("component") = i; params.set("variable") = vars[i]; diff --git a/src/base/RedbackApp.C b/src/base/RedbackApp.C index e3c576ef..90921458 100644 --- a/src/base/RedbackApp.C +++ b/src/base/RedbackApp.C @@ -29,6 +29,8 @@ InputParameters RedbackApp::validParams() { InputParameters params = MooseApp::validParams(); + params.set("use_legacy_material_output") = false; + params.set("use_legacy_initial_residual_evaluation_behavior") = false; return params; } @@ -42,11 +44,10 @@ RedbackApp::~RedbackApp() {} void RedbackApp::registerAll(Factory & f, ActionFactory & af, Syntax & s) { + ModulesApp::registerAllObjects(f, af, s); Registry::registerObjectsTo(f, {"RedbackApp"}); Registry::registerActionsTo(af, {"RedbackApp"}); - ModulesApp::registerAll(f, af, s); - /* register custom execute flags, action syntax, etc. here */ RedbackApp::associateSyntax(s, af); } diff --git a/src/main.C b/src/main.C index 4a8830ae..549682f0 100644 --- a/src/main.C +++ b/src/main.C @@ -1,27 +1,18 @@ -#include "AppFactory.h" -#include "Moose.h" -#include "MooseApp.h" -#include "MooseInit.h" -#include "RedbackApp.h" +//* This file is part of the MOOSE framework +//* https://www.mooseframework.org +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html -// Create a performance log -PerfLog Moose::perf_log("Redback"); +#include "RedbackApp.h" +#include "MooseMain.h" // Begin the main program. int main(int argc, char * argv[]) { - // Initialize MPI, solvers and MOOSE - MooseInit init(argc, argv); - - // Register this application's MooseApp and any it depends on - RedbackApp::registerApps(); - - // Create an instance of the application and store it in a smart pointer for easy cleanup - std::shared_ptr app = AppFactory::createAppShared("RedbackApp", argc, argv); - - // Execute the application - app->run(); - - return 0; + return Moose::main(argc, argv); } diff --git a/src/materials/RedbackFluidMaterial.C b/src/materials/RedbackFluidMaterial.C index 903e4fe1..4e78bb16 100644 --- a/src/materials/RedbackFluidMaterial.C +++ b/src/materials/RedbackFluidMaterial.C @@ -133,9 +133,9 @@ RedbackFluidMaterial::computeRedbackTerms() _froude_number[_qp] = _froude_number_param; _viscosity_ratio[_qp] = _viscosity_ratio_param; - Real fluid_density; - fluid_density = (1 + _fluid_compressibility_param * _pore_pres[_qp] - - _fluid_thermal_expansion_param * _T[_qp]); + // Real fluid_density; + // fluid_density = (1 + _fluid_compressibility_param * _pore_pres[_qp] - + // _fluid_thermal_expansion_param * _T[_qp]); // Gravity term in the momentum kernel _gravity_term[_qp] = _gravity_param / pow(_froude_number[_qp], 2); diff --git a/src/materials/RedbackMaterial.C b/src/materials/RedbackMaterial.C index 60b5c145..38abedb3 100644 --- a/src/materials/RedbackMaterial.C +++ b/src/materials/RedbackMaterial.C @@ -22,9 +22,9 @@ RedbackMaterial::validParams() InputParameters params = Material::validParams(); params.addParam>( - "init_from_functions__params", "The names of the parameters to be initialised as functions."); + "init_from_functions__params",{}, "The names of the parameters to be initialised as functions."); params.addParam>( - "init_from_functions__function_names", + "init_from_functions__function_names",{}, "The corresponding names of the functions to be used for the parameters " "to be initialised as functions."); params.addRangeCheckedParam("phi0", 0.0, "phi0>=0 & phi0<1", "initial porosity value."); @@ -614,7 +614,7 @@ _ar_F[_qp] * _delta[_qp] * (1 - _total_porosity[_qp]) * (1 - _solid_ratio[_qp]) if (_are_convective_terms_on) { Real solid_density, fluid_density; - Real lambda_m_star, one_minus_phi_lambda_s, phi_lambda_f; + Real /*lambda_m_star,*/ one_minus_phi_lambda_s, phi_lambda_f; RealVectorValue mixture_velocity, normalized_gravity; // Forming the partial densities and gravity terms @@ -649,8 +649,8 @@ _ar_F[_qp] * _delta[_qp] * (1 - _total_porosity[_qp]) * (1 - _solid_ratio[_qp]) phi_lambda_f = _total_porosity[_qp] * _fluid_thermal_expansion[_qp]; // normalized thermal // expansion coefficient of // the fluid phase - lambda_m_star = - one_minus_phi_lambda_s + phi_lambda_f; // normalized compressibility of the mixture + // lambda_m_star = + // one_minus_phi_lambda_s + phi_lambda_f; // normalized compressibility of the mixture // Forming the velocities through mechanics and Darcy's flow law if (_total_porosity[_qp] != 0) diff --git a/src/materials/RedbackMechMaterial.C b/src/materials/RedbackMechMaterial.C index d84a53bd..5c5f481d 100644 --- a/src/materials/RedbackMechMaterial.C +++ b/src/materials/RedbackMechMaterial.C @@ -54,7 +54,7 @@ RedbackMechMaterial::validParams() // params.addRequiredParam< std::vector >("yield_stress", "Input data as // pairs of equivalent plastic strain and yield stress: Should start with // equivalent plastic strain 0"); - params.addParam>("yield_stress", + params.addParam>("yield_stress",{}, "Input data as pairs of equivalent " "plastic strain and yield stress: Should " "start with equivalent plastic strain 0"); @@ -96,7 +96,7 @@ RedbackMechMaterial::validParams() "temperature_reference", 0.0, "Reference temperature used for thermal expansion"); params.addParam("pressure_reference", 0.0, "Reference pressure used for compressibility"); params.addParam>( - "initial_stress", + "initial_stress",{}, "A list of functions describing the initial stress. If provided, there " "must be 9 of these, corresponding to the xx, yx, zx, xy, yy, zy, xz, yz, " "zz components respectively. If not provided, all components of the " @@ -316,9 +316,10 @@ RedbackMechMaterial::computeStrain() for (_qp = 0; _qp < _qrule->n_points(); ++_qp) { // Deformation gradient - RankTwoTensor A( + auto A = RankTwoTensor ::initializeFromRows( _grad_disp_x[_qp], _grad_disp_y[_qp], _grad_disp_z[_qp]); // Deformation gradient - RankTwoTensor Fbar(_grad_disp_x_old[_qp], + auto Fbar = RankTwoTensor ::initializeFromRows( + _grad_disp_x_old[_qp], _grad_disp_y_old[_qp], _grad_disp_z_old[_qp]); // Old Deformation gradient diff --git a/src/meshgenerators/BreakMeshBySidesetGenerator.C b/src/meshgenerators/BreakMeshBySidesetGenerator.C index f16a9daa..c47918f2 100644 --- a/src/meshgenerators/BreakMeshBySidesetGenerator.C +++ b/src/meshgenerators/BreakMeshBySidesetGenerator.C @@ -1067,13 +1067,13 @@ BreakMeshBySidesetGenerator::addLowerDElements(MeshBase & mesh) subdomain_id_type BreakMeshBySidesetGenerator::findFreeBlockId(MeshBase & mesh) { - auto blocks = MooseMeshUtils::getSubdomainIDs(mesh, {"ANY_BLOCK_ID"}); - std::set current_block_ids(blocks.begin(), blocks.end()); + std::set currentBlockIds; + mesh.subdomain_ids(currentBlockIds); bool free_block_not_found = true; subdomain_id_type free_id; for (free_id = 0; free_id < std::numeric_limits::max(); free_id++) { - if (current_block_ids.count(free_id) == 0) + if (currentBlockIds.count(free_id) == 0) { // bid is not in the set, block ID is free free_block_not_found = false; diff --git a/tests/image_meshing/adaptivity_loop.i b/tests/image_meshing/adaptivity_loop.i index b87c6077..16f65aa0 100644 --- a/tests/image_meshing/adaptivity_loop.i +++ b/tests/image_meshing/adaptivity_loop.i @@ -18,7 +18,7 @@ [Functions] [./image_func] type = ImageFunction - threshold = 90 + threshold = 6e4 file_suffix = png #these 2 lines needs to be paste in the next step of the simulation #the image folder and the images selected diff --git a/tests/image_meshing/image_reader.i b/tests/image_meshing/image_reader.i index eafe3c49..1af1575e 100644 --- a/tests/image_meshing/image_reader.i +++ b/tests/image_meshing/image_reader.i @@ -21,7 +21,7 @@ type = ImageSubdomainGenerator input = generate file_suffix = png - threshold = 90 + threshold = 6e4 #the image folder and the images selected file_base = stack/test_0 #file_range = '32'