Permalink
Browse files

Merge pull request #12588 from bwspenc/use_displaced_mesh_mesh

Add option to suppress creation of displaced mesh
  • Loading branch information...
permcody committed Dec 10, 2018
2 parents b15455d + 7c5a3dc commit 5153fa5522e312bfbe480faf7c49a93da3297e24
@@ -23,7 +23,14 @@ validParams<CreateDisplacedProblemAction>()
"displacements",
"The variables corresponding to the x y z displacements of the mesh. If "
"this is provided then the displacements will be taken into account during "
"the computation.");
"the computation. Creation of the displaced mesh can be suppressed even if "
"this is set by setting 'use_displaced_mesh = false'.");
params.addParam<bool>(
"use_displaced_mesh",
true,
"Create the displaced mesh if the 'displacements' "
"parameter is set. If this is 'false', a displaced mesh will not be created, "
"regardless of whether 'displacements' is set.");

return params;
}
@@ -36,7 +43,7 @@ CreateDisplacedProblemAction::CreateDisplacedProblemAction(InputParameters param
void
CreateDisplacedProblemAction::act()
{
if (isParamValid("displacements"))
if (isParamValid("displacements") && getParam<bool>("use_displaced_mesh"))
{
if (!_displaced_mesh)
mooseError("displacements were set but a displaced mesh wasn't created!");
@@ -50,7 +50,14 @@ validParams<SetupMeshAction>()
"displacements",
"The variables corresponding to the x y z displacements of the mesh. If "
"this is provided then the displacements will be taken into account during "
"the computation.");
"the computation. Creation of the displaced mesh can be suppressed even if "
"this is set by setting 'use_displaced_mesh = false'.");
params.addParam<bool>(
"use_displaced_mesh",
true,
"Create the displaced mesh if the 'displacements' "
"parameter is set. If this is 'false', a displaced mesh will not be created, "
"regardless of whether 'displacements' is set.");
params.addParam<std::vector<BoundaryName>>("ghosted_boundaries",
"Boundaries to be ghosted if using Nemesis");
params.addParam<std::vector<Real>>("ghosted_boundaries_inflation",
@@ -208,14 +215,14 @@ SetupMeshAction::act()
}

_mesh = _factory.create<MooseMesh>(_type, "mesh", _moose_object_pars);
if (isParamValid("displacements"))
if (isParamValid("displacements") && getParam<bool>("use_displaced_mesh"))
_displaced_mesh = _factory.create<MooseMesh>(_type, "displaced_mesh", _moose_object_pars);
}
else if (_current_task == "init_mesh")
{
_mesh->init();

if (isParamValid("displacements"))
if (isParamValid("displacements") && getParam<bool>("use_displaced_mesh"))
{
// Initialize the displaced mesh
_displaced_mesh->init();
@@ -153,6 +153,7 @@

[Kernels]
[./TensorMechanics]
use_displaced_mesh = true
[../]
[]

@@ -10,6 +10,48 @@
'ComputeFiniteStrainElasticStress.md'
issues = '#458'
[../]
[./elastic_patch_incremental_small]
type = 'Exodiff'
input = 'elastic_patch.i'
cli_args = 'Materials/strain/type=ComputeIncrementalSmallStrain Kernels/TensorMechanics/use_displaced_mesh=false Outputs/file_base=elastic_patch_small_out'
exodiff = 'elastic_patch_small_out.e'
requirement = 'The tensor mechanics module shall have the ability to '
'compute spatially uniform stresses under prescribed '
'linearly varying displacements on a set of irregular hexes '
'using an incremental small-strain calculation.'
design = 'ElasticEnergyAux.md ComputeIsotropicElasticityTensor.md '
'ComputeIncrementalSmallStrain.md ComputeFiniteStrainElasticStress.md'
issues = '#12584'
[../]
[./elastic_patch_total_small]
prereq = elastic_patch_incremental_small
type = 'Exodiff'
input = 'elastic_patch.i'
cli_args = 'Materials/strain/type=ComputeSmallStrain Materials/stress/type=ComputeLinearElasticStress Kernels/TensorMechanics/use_displaced_mesh=false Outputs/file_base=elastic_patch_small_out'
exodiff = 'elastic_patch_small_out.e'
requirement = 'The tensor mechanics module shall have the ability to '
'compute spatially uniform stresses under prescribed '
'linearly varying displacements on a set of irregular hexes '
'using an total small-strain calculation.'
design = 'ElasticEnergyAux.md ComputeIsotropicElasticityTensor.md '
'ComputeSmallStrain.md ComputeLinearElasticStress.md'
issues = '#12584'
[../]
[./elastic_patch_incremental_small_no_disp_mesh]
prereq = elastic_patch_total_small
type = 'Exodiff'
input = 'elastic_patch.i'
cli_args = 'Mesh/use_displaced_mesh=false Materials/strain/type=ComputeIncrementalSmallStrain Kernels/TensorMechanics/use_displaced_mesh=false Outputs/file_base=elastic_patch_small_out'
exodiff = 'elastic_patch_small_out.e'
requirement = 'The tensor mechanics module shall have the ability to '
'compute spatially uniform stresses under prescribed '
'linearly varying displacements on a set of irregular hexes '
'using an incremental small-strain calculation with no displaced '
'mesh created.'
design = 'ElasticEnergyAux.md ComputeIsotropicElasticityTensor.md '
'ComputeIncrementalSmallStrain.md ComputeFiniteStrainElasticStress.md'
issues = '#12584 #12580'
[../]
[./elastic_patch_Bbar]
type = 'Exodiff'
input = 'elastic_patch.i'
@@ -7,6 +7,9 @@
exodiff = 'displaced_adapt_test_out.e-s003'
recover = false
max_parallel = 1
requirement = "The system shall be able to output the displaced mesh for a model with adaptive mesh refinement."
design = "Outputs/index.md Adaptivity/index.md"
issues = "#1927"
[../]

[./non_displaced_fallback]
@@ -17,4 +20,15 @@
design = "Outputs/index.md"
issues = "#11309"
[../]

[./mesh_use_displaced_mesh_false]
prereq = non_displaced_fallback
type = 'RunException'
input = 'non_displaced_fallback.i'
cli_args = 'Mesh/displacements=a Mesh/use_displaced_mesh=false'
expect_err = "Parameter 'use_displaced' ignored, there is no displaced problem in your simulation."
requirement = "If the user asks for no displaced mesh to be created, even though displacements are provided in the mesh block, the system shall not create a displaced mesh"
design = "syntax/Mesh/index.md"
issues = "#12580"
[../]
[]

0 comments on commit 5153fa5

Please sign in to comment.