www.mooseframework.org
TaggingInterface.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "MooseTypes.h"
13 #include "MultiMooseEnum.h"
14 
15 #include "libmesh/dense_vector.h"
16 #include "libmesh/dense_matrix.h"
17 
18 // Forward declarations
19 class InputParameters;
20 class MooseObject;
21 class TaggingInterface;
22 class SubProblem;
23 class Assembly;
24 
25 template <typename T>
27 
28 template <>
30 
32 {
33 public:
34  TaggingInterface(const MooseObject * moose_object);
35  virtual ~TaggingInterface();
36 
37  void useVectorTag(const TagName & tag_name);
38 
39  void useMatrixTag(const TagName & tag_name);
40 
41  void useVectorTag(TagID tag_id);
42 
43  void useMatrixTag(TagID tag_id);
44 
45  bool isVectorTagged() { return _vector_tags.size() > 0; }
46 
47  bool isMatrixTagged() { return _matrix_tags.size() > 0; }
48 
49  const std::set<TagID> & getVectorTags() const { return _vector_tags; }
50 
51  const std::set<TagID> & getMatrixTags() const { return _matrix_tags; }
52 
59  void prepareVectorTag(Assembly & assembly, unsigned int ivar);
60 
68  void prepareVectorTagNeighbor(Assembly & assembly, unsigned int ivar);
69 
75  void prepareVectorTagLower(Assembly & assembly, unsigned int ivar);
76 
83  void prepareMatrixTag(Assembly & assembly, unsigned int ivar, unsigned int jvar);
84 
92  void prepareMatrixTagNeighbor(Assembly & assembly,
93  unsigned int ivar,
94  unsigned int jvar,
96 
102  void prepareMatrixTagLower(Assembly & assembly,
103  unsigned int ivar,
104  unsigned int jvar,
106 
112 
118 
124 
130 
131 protected:
133  std::set<TagID> _vector_tags;
134 
136  std::set<TagID> _matrix_tags;
137 
140 
143 
146 
148  std::vector<DenseVector<Number> *> _re_blocks;
149 
151  std::vector<DenseMatrix<Number> *> _ke_blocks;
152 
154  DenseVector<Number> _local_re;
155 
157  DenseMatrix<Number> _local_ke;
158 };
159 
160 #define usingTaggingInterfaceMembers \
161  using TaggingInterface::_subproblem; \
162  using TaggingInterface::accumulateTaggedLocalResidual; \
163  using TaggingInterface::accumulateTaggedLocalMatrix; \
164  using TaggingInterface::prepareVectorTag; \
165  using TaggingInterface::prepareMatrixTag; \
166  using TaggingInterface::prepareVectorTagNeighbor; \
167  using TaggingInterface::_local_re; \
168  using TaggingInterface::prepareVectorTagLower; \
169  using TaggingInterface::prepareMatrixTagNeighbor; \
170  using TaggingInterface::prepareMatrixTagLower; \
171  using TaggingInterface::_local_ke
SubProblem & _subproblem
SubProblem that contains tag info.
const InputParameters & _tag_params
Parameters from moose object.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
Keeps track of stuff related to assembling.
Definition: Assembly.h:62
unsigned int TagID
Definition: MooseTypes.h:162
void assignTaggedLocalMatrix()
Local Jacobian blocks will assigned as the current local kernel Jacobian.
void assignTaggedLocalResidual()
Local residual blocks will assigned as the current local kernel residual.
const std::set< TagID > & getVectorTags() const
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< DenseVector< Number > * > _re_blocks
Residual blocks Vectors For each Tag.
void useMatrixTag(const TagName &tag_name)
DenseMatrix< Number > _local_ke
Holds residual entries as they are accumulated by this Kernel.
void prepareMatrixTagNeighbor(Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type)
Prepare data for computing element jacobian according to the ative tags for DG and interface kernels...
TaggingInterface(const MooseObject *moose_object)
InputParameters validParams()
This is the templated validParams() function that every MooseObject-derived class is required to spec...
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
std::set< TagID > _matrix_tags
The matrices this Kernel will contribute to.
std::set< TagID > _vector_tags
The vectors this Kernel will contribute to.
void useVectorTag(const TagName &tag_name)
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
DGJacobianType
Definition: MooseTypes.h:515
MatType type
void prepareVectorTagNeighbor(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual the according to active tags for DG and interface kernels...
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:59
const std::set< TagID > & getMatrixTags() const
ConstraintJacobianType
Definition: MooseTypes.h:543
InputParameters validParams< TaggingInterface >()
void prepareMatrixTagLower(Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::ConstraintJacobianType type)
Prepare data for computing the jacobian according to the ative tags for mortar.
DenseVector< Number > _local_re
Holds residual entries as they are accumulated by this Kernel.
const MooseObject & _moose_object
Moose objct this tag works on.
virtual ~TaggingInterface()
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 prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual the according to active tags.
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing element jacobian according to the ative tags.