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 #13057 from aeslaughter/ad-kernel-stabilized-13044
Create a generalized stabilization ADKernel
- Loading branch information
Showing
4 changed files
with
241 additions
and
160 deletions.
There are no files selected for viewing
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,54 @@ | |||
//* 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 | |||
|
|||
#ifndef ADKERNELSTABILIZED_H | |||
#define ADKERNELSTABILIZED_H | |||
|
|||
#include "ADKernel.h" | |||
|
|||
#define usingTemplKernelStabilizedMembers(type) usingTemplKernelMembers(type) | |||
#define usingKernelStabilizedMembers usingTemplKernelStabilizedMembers(Real) | |||
#define usingVectorKernelStabilizedMembers usingTemplKernelStabilizedMembers(RealVectorValue) | |||
|
|||
template <typename, ComputeStage> | |||
class ADKernelStabilizedTempl; | |||
|
|||
template <ComputeStage compute_stage> | |||
using ADKernelStabilized = ADKernelStabilizedTempl<Real, compute_stage>; | |||
template <ComputeStage compute_stage> | |||
using ADVectorKernelStabilized = ADKernelStabilizedTempl<RealVectorValue, compute_stage>; | |||
|
|||
declareADValidParams(ADKernelStabilized); | |||
declareADValidParams(ADVectorKernelStabilized); | |||
|
|||
template <typename T, ComputeStage compute_stage> | |||
class ADKernelStabilizedTempl : public ADKernelTempl<T, compute_stage> | |||
{ | |||
public: | |||
ADKernelStabilizedTempl(const InputParameters & parameters); | |||
|
|||
virtual void computeResidual() override; | |||
virtual void computeJacobian() override; | |||
virtual void computeADOffDiagJacobian() override; | |||
|
|||
protected: | |||
/** | |||
* Called before forming the residual for an element | |||
*/ | |||
virtual typename OutputTools<typename Moose::ValueType<T, compute_stage>::type>::OutputValue | |||
precomputeQpStrongResidual() = 0; | |||
|
|||
virtual ADRealVectorValue computeQpStabilization() = 0; | |||
|
|||
virtual ADResidual computeQpResidual() override final; | |||
|
|||
usingTemplKernelMembers(T); | |||
}; | |||
|
|||
#endif /* ADKERNELSTABILIZED_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
Oops, something went wrong.