forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update neml2 submodule - Remove dependency on LabeledTensor - Update all neml2 models - Update all moose-neml2 input files - Attempted to speedup data transfer between moose and neml2 - Make moose data types trivially copyable - Add a neml2 crystal plasticity example - Add ability to initialize neml2 variables in neml2 action ref idaholab#29579
- Loading branch information
1 parent
dc0e9c8
commit 1585b08
Showing
57 changed files
with
1,209 additions
and
682 deletions.
There are no files selected for viewing
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
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.