www.mooseframework.org
KernelWarehouse.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef KERNELWAREHOUSE_H
16 #define KERNELWAREHOUSE_H
17 
18 // MOOSE includes
19 #include "MooseObjectWarehouse.h"
20 #include "MooseTypes.h"
21 #include "MooseError.h"
22 
23 // Forward declarations
24 class KernelBase;
25 class ScalarKernel;
26 class TimeKernel;
27 
31 class KernelWarehouse : public MooseObjectWarehouse<KernelBase>
32 {
33 public:
35 
39  void addObject(std::shared_ptr<KernelBase> object, THREAD_ID tid = 0) override;
40 
42 
45  bool hasActiveVariableBlockObjects(unsigned int variable_id,
46  SubdomainID block_id,
47  THREAD_ID tid = 0) const;
48  const std::vector<std::shared_ptr<KernelBase>> & getActiveVariableBlockObjects(
49  unsigned int variable_id, SubdomainID block_id, THREAD_ID tid = 0) const;
51 
55  virtual void updateActive(THREAD_ID tid = 0) override;
56 
57 protected:
59  std::map<unsigned int, MooseObjectWarehouse<KernelBase>> _variable_kernel_storage;
60 };
61 
62 #endif // KERNELWAREHOUSE_H
const std::vector< std::shared_ptr< KernelBase > > & getActiveVariableBlockObjects(unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
subdomain_id_type SubdomainID
Definition: MooseTypes.h:77
A storage container for MooseObjects that inherit from SetupInterface.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
This is the common base class for the two main kernel types implemented in MOOSE, EigenKernel and Ker...
Definition: KernelBase.h:47
Holds kernels and provides some services.
All time kernels should inherit from this class.
Definition: TimeKernel.h:30
void addObject(std::shared_ptr< KernelBase > object, THREAD_ID tid=0) override
Add Kernel to the storage structure.
bool hasActiveVariableBlockObjects(unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
Methods for checking/getting variable kernels for a variable and SubdomainID.
unsigned int THREAD_ID
Definition: MooseTypes.h:79
std::map< unsigned int, MooseObjectWarehouse< KernelBase > > _variable_kernel_storage
Variable based storage.