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.
- Loading branch information
Showing
3 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
modules/tensor_mechanics/include/userobjects/ProjectedStatefulMaterialNodalPatchRecovery.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,35 @@ | ||
//* 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 | ||
|
||
// MOOSE includes | ||
#include "NodalPatchRecoveryMaterialProperty.h" | ||
|
||
/** | ||
* Nodal patch recovery for material property components for projected stateful properties | ||
*/ | ||
class ProjectedStatefulMaterialNodalPatchRecovery : public NodalPatchRecoveryMaterialProperty | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
ProjectedStatefulMaterialNodalPatchRecovery(const InputParameters & parameters); | ||
|
||
virtual void initialSetup() override; | ||
virtual void subdomainSetup() override; | ||
|
||
protected: | ||
virtual Real computeValue() override; | ||
|
||
const SubdomainID & _current_subdomain_id; | ||
|
||
std::set<MaterialBase *> _all_materials; | ||
std::vector<MaterialBase *> _active_materials; | ||
}; |
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
55 changes: 55 additions & 0 deletions
55
modules/tensor_mechanics/src/userobjects/ProjectedStatefulMaterialNodalPatchRecovery.C
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,55 @@ | ||
//* 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 "ProjectedStatefulMaterialNodalPatchRecovery.h" | ||
|
||
registerMooseObject("TensorMechanicsApp", ProjectedStatefulMaterialNodalPatchRecovery); | ||
|
||
InputParameters | ||
ProjectedStatefulMaterialNodalPatchRecovery::validParams() | ||
{ | ||
InputParameters params = NodalPatchRecoveryMaterialProperty::validParams(); | ||
return params; | ||
} | ||
|
||
ProjectedStatefulMaterialNodalPatchRecovery::ProjectedStatefulMaterialNodalPatchRecovery( | ||
const InputParameters & parameters) | ||
: NodalPatchRecoveryMaterialProperty(parameters), | ||
_current_subdomain_id(_assembly.currentSubdomainID()) | ||
{ | ||
} | ||
|
||
void | ||
ProjectedStatefulMaterialNodalPatchRecovery::initialSetup() | ||
{ | ||
NodalPatchRecoveryMaterialProperty::initialSetup(); | ||
|
||
// get all material classes that provide properties for this object | ||
_all_materials = getSupplyerMaterials(); | ||
} | ||
|
||
void | ||
ProjectedStatefulMaterialNodalPatchRecovery::subdomainSetup() | ||
{ | ||
// get materials for the current subdomain | ||
_active_materials.clear(); | ||
for (const auto & mat : _all_materials) | ||
if (mat->hasBlocks(_current_subdomain_id)) | ||
_active_materials.push_back(mat); | ||
} | ||
|
||
Real | ||
ProjectedStatefulMaterialNodalPatchRecovery::computeValue() | ||
{ | ||
if (_t_step == 0) | ||
for (const auto & mat : _active_materials) | ||
mat->initStatefulProperties(_qrule->size()); | ||
|
||
return _prop[_qp]; | ||
} |