forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request idaholab#29580 from hugary1995/neml2_v2
NEML2 submodule update. This update brings out-of-place evaluation, JIT, along with various other improvements and bug fixes to MOOSE. Most notably, the NEML2 Action in MOOSE has been significantly improved to simplify model setup and allow block restriction.
- Loading branch information
Showing
65 changed files
with
1,331 additions
and
703 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
framework/doc/content/source/materials/GenericConstantRealVectorValue.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# GenericConstantRealVectorValue | ||
|
||
!syntax description /Materials/GenericConstantRealVectorValue | ||
|
||
## Overview | ||
|
||
`GenericConstantRealVectorValue` creates a `RealVectorValue` material property that use | ||
constant values to fill the value. | ||
|
||
This can be used to quickly create simple constant 3-vector properties, for testing, | ||
for initial survey of a problem or simply because the material properties do not vary much over the | ||
domain explored by the simulation. | ||
|
||
The AD counterpart `ADGenericConstantRealVectorValue` creates a `ADRealVectorValue` material property. | ||
|
||
## Example Input File Syntax | ||
|
||
!listing test/tests/materials/generic_materials/generic_constant_real_vector_value.i block=Materials/vector | ||
|
||
!syntax parameters /Materials/GenericConstantRealVectorValue | ||
|
||
!syntax inputs /Materials/GenericConstantRealVectorValue | ||
|
||
!syntax children /Materials/GenericConstantRealVectorValue |
34 changes: 34 additions & 0 deletions
34
framework/include/materials/GenericConstantRealVectorValue.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//* 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 | ||
|
||
#pragma once | ||
|
||
#include "Material.h" | ||
|
||
/** | ||
* Declares a constant material property of type RealVectorValue. | ||
*/ | ||
template <bool is_ad> | ||
class GenericConstantRealVectorValueTempl : public Material | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
GenericConstantRealVectorValueTempl(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual void initQpStatefulProperties() override; | ||
virtual void computeQpProperties() override; | ||
|
||
const RealVectorValue _vector; | ||
GenericMaterialProperty<RealVectorValue, is_ad> & _prop; | ||
}; | ||
|
||
typedef GenericConstantRealVectorValueTempl<false> GenericConstantRealVectorValue; | ||
typedef GenericConstantRealVectorValueTempl<true> ADGenericConstantRealVectorValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//* 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 | ||
|
||
#include "GenericConstantRealVectorValue.h" | ||
|
||
registerMooseObject("MooseApp", GenericConstantRealVectorValue); | ||
registerMooseObject("MooseApp", ADGenericConstantRealVectorValue); | ||
|
||
template <bool is_ad> | ||
InputParameters | ||
GenericConstantRealVectorValueTempl<is_ad>::validParams() | ||
{ | ||
InputParameters params = Material::validParams(); | ||
params.addClassDescription("Object for declaring a constant 3-vector as a material property."); | ||
params.addRequiredParam<RealVectorValue>("vector_values", "Values defining the constant vector"); | ||
params.addRequiredParam<MaterialPropertyName>( | ||
"vector_name", "Name of the vector material property to be created"); | ||
params.set<MooseEnum>("constant_on") = "SUBDOMAIN"; | ||
return params; | ||
} | ||
|
||
template <bool is_ad> | ||
GenericConstantRealVectorValueTempl<is_ad>::GenericConstantRealVectorValueTempl( | ||
const InputParameters & parameters) | ||
: Material(parameters), | ||
_vector(getParam<RealVectorValue>("vector_values")), | ||
_prop(declareGenericProperty<RealVectorValue, is_ad>( | ||
getParam<MaterialPropertyName>("vector_name"))) | ||
{ | ||
} | ||
|
||
template <bool is_ad> | ||
void | ||
GenericConstantRealVectorValueTempl<is_ad>::initQpStatefulProperties() | ||
{ | ||
GenericConstantRealVectorValueTempl<is_ad>::computeQpProperties(); | ||
} | ||
|
||
template <bool is_ad> | ||
void | ||
GenericConstantRealVectorValueTempl<is_ad>::computeQpProperties() | ||
{ | ||
_prop[_qp] = _vector; | ||
} | ||
|
||
template class GenericConstantRealVectorValueTempl<false>; | ||
template class GenericConstantRealVectorValueTempl<true>; |
8 changes: 4 additions & 4 deletions
8
modules/combined/test/tests/optimization/invOpt_elasticity_modular/elasticity.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
[Models] | ||
[adjoint_elasticity_model] | ||
type = LinearIsotropicElasticity | ||
youngs_modulus = 5.0 | ||
poisson_ratio = 0.3 | ||
coefficients = '5.0 0.3' | ||
coefficient_types = 'YOUNGS_MODULUS POISSONS_RATIO' | ||
strain = 'forces/E' | ||
[] | ||
[forward_elasticity_model] | ||
type = LinearIsotropicElasticity | ||
youngs_modulus = 5.0 | ||
poisson_ratio = 0.3 | ||
coefficients = '5.0 0.3' | ||
coefficient_types = 'YOUNGS_MODULUS POISSONS_RATIO' | ||
strain = 'forces/E' | ||
[] | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
.../doc/content/source/materials/lagrangian/ComputeLagrangianCauchyCustomStress.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ComputeLagrangianCauchyCustomStress | ||
|
||
Wrapper for constitutive model with a user-defined Cauchy stress and Cauchy stress Jacobian, useful for coupling with 3rd party libraries which define custom stress-strain relations. | ||
|
||
!syntax description /Materials/ComputeLagrangianCauchyCustomStress | ||
|
||
!syntax parameters /Materials/ComputeLagrangianCauchyCustomStress | ||
|
||
!syntax inputs /Materials/ComputeLagrangianCauchyCustomStress |
16 changes: 1 addition & 15 deletions
16
...c/content/source/materials/lagrangian/ComputeLagrangianObjectiveCustomStress.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,9 @@ | ||
# ComputeLagrangianObjectiveCustomSymmetricStress | ||
|
||
!alert construction title=Undocumented Class | ||
The ComputeLagrangianObjectiveCustomSymmetricStress has not been documented. The content listed below should be used as a starting point for | ||
documenting the class, which includes the typical automatic documentation associated with a | ||
MooseObject; however, what is contained is ultimately determined by what is necessary to make the | ||
documentation clear for users. | ||
Objectively integrated constitutive model with a user-defined small stress and small stress Jacobian, useful for coupling with 3rd party libraries which define custom stress-strain relations. | ||
|
||
!syntax description /Materials/ComputeLagrangianObjectiveCustomSymmetricStress | ||
|
||
## Overview | ||
|
||
!! Replace these lines with information regarding the ComputeLagrangianObjectiveCustomSymmetricStress object. | ||
|
||
## Example Input File Syntax | ||
|
||
!! Describe and include an example of how to use the ComputeLagrangianObjectiveCustomSymmetricStress object. | ||
|
||
!syntax parameters /Materials/ComputeLagrangianObjectiveCustomSymmetricStress | ||
|
||
!syntax inputs /Materials/ComputeLagrangianObjectiveCustomSymmetricStress | ||
|
||
!syntax children /Materials/ComputeLagrangianObjectiveCustomSymmetricStress |
30 changes: 30 additions & 0 deletions
30
modules/solid_mechanics/include/materials/lagrangian/ComputeLagrangianCauchyCustomStress.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//* 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 | ||
|
||
#pragma once | ||
|
||
#include "ComputeLagrangianStressCauchy.h" | ||
#include "DerivativeMaterialPropertyNameInterface.h" | ||
|
||
/// Provide the Cauchy stress and jacobian directly | ||
/// | ||
class ComputeLagrangianCauchyCustomStress : public ComputeLagrangianStressCauchy, | ||
public DerivativeMaterialPropertyNameInterface | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
ComputeLagrangianCauchyCustomStress(const InputParameters & parameters); | ||
|
||
protected: | ||
/// Implement the copy | ||
virtual void computeQpCauchyStress() override; | ||
|
||
const MaterialProperty<RankTwoTensor> & _custom_stress; | ||
const MaterialProperty<RankFourTensor> & _custom_jacobian; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.