19 #include "libmesh/dense_vector.h" 20 #include "metaphysicl/raw_type.h" 81 void useVectorTag(
const TagName & tag_name, VectorTagsKey);
83 void useMatrixTag(
const TagName & tag_name, MatrixTagsKey);
226 template <
typename Res
iduals,
typename Indices>
228 const Residuals & residuals,
229 const Indices & dof_indices,
230 Real scaling_factor);
235 template <
typename T,
typename Indices>
237 const DenseVector<T> & residuals,
238 const Indices & dof_indices,
239 Real scaling_factor);
245 template <
typename Res
iduals,
typename Indices>
247 const Residuals & residuals,
248 const Indices & dof_indices,
249 Real scaling_factor);
254 template <
typename Res
iduals,
typename Indices>
256 const Residuals & residuals,
257 const Indices & dof_indices,
258 Real scaling_factor);
265 template <
typename Res
iduals,
typename Indices>
267 const Residuals & residuals,
268 const Indices & dof_indices,
269 Real scaling_factor);
276 template <
typename Res
iduals,
typename Indices>
278 const Residuals & residuals,
279 const Indices & dof_indices,
280 Real scaling_factor);
287 template <
typename Res
iduals,
typename Indices>
289 const Residuals & residuals,
290 const Indices & dof_indices,
291 Real scaling_factor);
300 Real scaling_factor);
307 const std::vector<dof_id_type> & row_indices,
308 const std::vector<dof_id_type> & column_indices,
309 Real scaling_factor);
314 template <
typename T>
325 template <
typename SetRes
idualFunctor>
349 const std::set<TagID> & vector_tags,
350 const std::set<TagID> & absolute_value_vector_tags);
401 #define usingTaggingInterfaceMembers \ 402 using TaggingInterface::_subproblem; \ 403 using TaggingInterface::accumulateTaggedLocalResidual; \ 404 using TaggingInterface::accumulateTaggedLocalMatrix; \ 405 using TaggingInterface::prepareVectorTag; \ 406 using TaggingInterface::prepareMatrixTag; \ 407 using TaggingInterface::prepareVectorTagNeighbor; \ 408 using TaggingInterface::_local_re; \ 409 using TaggingInterface::prepareVectorTagLower; \ 410 using TaggingInterface::prepareMatrixTagNeighbor; \ 411 using TaggingInterface::prepareMatrixTagLower; \ 412 using TaggingInterface::_local_ke 414 template <
typename Res
iduals,
typename Indices>
417 const Residuals & residuals,
418 const Indices & dof_indices,
419 const Real scaling_factor)
437 template <
typename T,
typename Indices>
440 const DenseVector<T> & residuals,
441 const Indices & dof_indices,
442 const Real scaling_factor)
444 addResiduals(assembly, residuals.get_values(), dof_indices, scaling_factor);
447 template <
typename Res
iduals,
typename Indices>
450 const Residuals & residuals,
451 const Indices & dof_indices,
452 const Real scaling_factor)
470 template <
typename Res
iduals,
typename Indices>
473 const Residuals & residuals,
474 const Indices & dof_indices,
477 addResiduals(assembly, residuals, dof_indices, scaling_factor);
478 addJacobian(assembly, residuals, dof_indices, scaling_factor);
481 template <
typename Res
iduals,
typename Indices>
484 const Residuals & residuals,
485 const Indices & dof_indices,
492 template <
typename Res
iduals,
typename Indices>
495 const Residuals & residuals,
496 const Indices & dof_indices,
503 template <
typename Res
iduals,
typename Indices>
506 const Residuals & residuals,
507 const Indices & dof_indices,
519 const Real scaling_factor)
528 const std::vector<dof_id_type> & row_indices,
529 const std::vector<dof_id_type> & column_indices,
530 const Real scaling_factor)
537 template <
typename T>
554 template <
typename SetRes
idualFunctor>
560 set_residual_functor(sys.
getVector(tag_id));
Nonlinear eigenvalue system to be solved.
void accumulateTaggedNonlocalMatrix()
Nonlocal Jacobian blocks will be appended by adding the current nonlocal kernel Jacobian.
std::set< TagID > _ref_abs_vector_tags
A set of either size 1 or 0.
SubProblem & _subproblem
SubProblem that contains tag info.
void addResidualsAndJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals and derivatives for the Jacobian, corresponding to the provided d...
const InputParameters & _tag_params
Parameters from moose object.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
bool hasVectorTags() const
Keeps track of stuff related to assembling.
void insertNodalValue(NumericVector< Number > &residual, const OutputData &v)
Write a nodal value to the passed-in solution vector.
void assignTaggedLocalMatrix()
Local Jacobian blocks will assigned as the current local kernel Jacobian.
void addResiduals(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals corresponding to the provided dof indices.
void assignTaggedLocalResidual()
Local residual blocks will assigned as the current local kernel residual.
std::vector< DenseVector< Number > * > _absre_blocks
Residual blocks for absolute value residual tags.
ResidualTagType
Enumerate whether a (residual) vector tag is to be of a non-reference or reference tag type...
std::vector< DenseVector< Number > * > _re_blocks
Residual blocks Vectors For each Tag.
std::set< TagID > _ref_vector_tags
A set of either size 1 or 0.
Base class for a system (of equations)
DenseMatrix< Number > _local_ke
Holds local Jacobian entries as they are accumulated by this Kernel.
std::set< TagID > _abs_vector_tags
The absolute value residual tag ids.
void cacheJacobian(GlobalDataKey)
Takes the values that are currently in _sub_Kee and appends them to the cached values.
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
void prepareMatrixTagNeighbor(Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type)
Prepare data for computing element jacobian according to the active tags for DG and interface kernels...
TaggingInterface(const MooseObject *moose_object)
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
InputParameters validParams()
std::set< TagID > _non_ref_abs_vector_tags
A set to hold absolute value vector tags excluding the reference residual tag.
void prepareMatrixTagNonlocal(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing nonlocal element jacobian according to the active tags.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Every object that can be built by the factory should be derived from this class.
std::set< TagID > _matrix_tags
The matrices this Kernel will contribute to.
void cacheJacobianWithoutConstraints(const Residuals &residuals, const Indices &row_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &matrix_tags)
Process the derivatives() data of a vector of ADReals.
void addResidualsAndJacobianWithoutConstraints(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals and derivatives for the Jacobian, corresponding to the provided d...
std::set< TagID > _non_ref_vector_tags
A set to hold vector tags excluding the reference residual tag.
std::set< TagID > _vector_tags
The residual tag ids this Kernel will contribute to.
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
A storage container for MooseObjects that inherit from SetupInterface.
FEProblemBase derived class to enable convergence checking relative to a user-specified postprocessor...
void cacheResiduals(const Residuals &residuals, const Indices &row_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &vector_tags)
Process the supplied residual values.
void useMatrixTag(const TagName &tag_name, MatrixTagsKey)
void prepareVectorTagNeighbor(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual the according to active tags for DG and interface kernels...
void constraintJacobians(bool displaced)
Add jacobian contributions from Constraints.
Generic class for solving transient nonlinear problems.
void prepareMatrixTagLower(Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::ConstraintJacobianType type)
Prepare data for computing the jacobian according to the active tags for mortar.
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
const MooseObject & _moose_object
Moose objct this tag works on.
const std::set< TagID > & getMatrixTags(MatrixTagsKey) const
void addResidualsWithoutConstraints(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals corresponding to the provided dof indices.
virtual ~TaggingInterface()
virtual void set(const numeric_index_type i, const Number value)=0
void cacheJacobianBlock(DenseMatrix< Number > &jac_block, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, Real scaling_factor, LocalDataKey, TagID tag)
Cache a local Jacobian block with the provided rows (idof_indices) and columns (jdof_indices) for eve...
std::vector< DenseMatrix< Number > * > _ke_blocks
Kernel blocks Vectors For each Tag.
void prepareVectorTagLower(Assembly &assembly, unsigned int ivar)
Prepare data for computing the residual according to active tags for mortar constraints.
void prepareVectorTagInternal(Assembly &assembly, unsigned int ivar, const std::set< TagID > &vector_tags, const std::set< TagID > &absolute_value_vector_tags)
Prepare data for computing element residual according to the specified tags Residual blocks for diffe...
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
void addJacobianWithoutConstraints(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing element jacobian according to the active tags.
void addJacobianElement(Assembly &assembly, Real value, dof_id_type row_index, dof_id_type column_index, Real scaling_factor)
Add into a single Jacobian element.
DenseMatrix< Number > _nonlocal_ke
Holds nonlocal Jacobian entries as they are accumulated by this Kernel.
static InputParameters validParams()
void setResidual(SystemBase &sys, const T &residual, MooseVariableFE< T > &var)
Set residual using the variables' insertion API.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
auto index_range(const T &sizable)
std::vector< Real > _absolute_residuals
A container to hold absolute values of residuals passed into addResiduals.
Key structure for APIs adding/caching local element residuals/Jacobians.
void useVectorTag(const TagName &tag_name, VectorTagsKey)
void cacheResidualsWithoutConstraints(const Residuals &residuals, const Indices &row_indices, Real scaling_factor, LocalDataKey, const std::set< TagID > &vector_tags)
Process the supplied residual values.
const std::set< TagID > & getVectorTags(VectorTagsKey) const