www.mooseframework.org
ExecStore.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 EXECSTORE_H
16 #define EXECSTORE_H
17 
18 #include <vector>
19 
20 #include "MooseTypes.h"
21 #include "libmesh/libmesh_base.h"
22 
30 template <typename T>
31 class ExecStore
32 {
33 public:
35  : _obj_initial(libMesh::n_threads()),
36  _obj_linear(libMesh::n_threads()),
37  _obj_nonlinear(libMesh::n_threads()),
38  _obj_timestep_end(libMesh::n_threads()),
39  _obj_timestep_begin(libMesh::n_threads()),
40  _obj_custom(libMesh::n_threads())
41  {
42  }
43 
49  std::vector<T> & operator()(ExecFlagType type)
50  {
51  switch (type)
52  {
53  case EXEC_INITIAL:
54  return _obj_initial;
55  case EXEC_TIMESTEP_END:
56  return _obj_timestep_end;
58  return _obj_timestep_begin;
59  case EXEC_NONLINEAR:
60  return _obj_nonlinear;
61  case EXEC_CUSTOM:
62  return _obj_custom;
63  case EXEC_LINEAR:
64  default:
65  return _obj_linear;
66  }
67  }
68 
69 protected:
71  std::vector<T> _obj_initial;
73  std::vector<T> _obj_linear;
75  std::vector<T> _obj_nonlinear;
77  std::vector<T> _obj_timestep_end;
79  std::vector<T> _obj_timestep_begin;
81  std::vector<T> _obj_custom;
82 };
83 
84 #endif /* EXECSTORE_H */
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
std::vector< T > _obj_custom
executed at a custom time by the Executioner
Definition: ExecStore.h:81
std::vector< T > _obj_timestep_begin
executed at the beginning of every time step
Definition: ExecStore.h:79
For use with custom executioners that want to fire objects at a specific time.
Definition: MooseTypes.h:110
Object is evaluated only once at the beginning of the simulation.
Definition: MooseTypes.h:94
std::vector< T > & operator()(ExecFlagType type)
Parenthesis operator for accessing the warehouses for different times.
Definition: ExecStore.h:49
std::vector< T > _obj_linear
executed every residual evaluation
Definition: ExecStore.h:73
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Object is evaluated at the end of every time step.
Definition: MooseTypes.h:100
std::vector< T > _obj_timestep_end
executed at the end of every time step
Definition: ExecStore.h:77
std::vector< T > _obj_nonlinear
executed every jacobian (nonlinear) evaluation
Definition: ExecStore.h:75
ExecStore()
Definition: ExecStore.h:34
std::vector< T > _obj_initial
executed once at the beginning of the simulation
Definition: ExecStore.h:71
MatType type
The class for storing warehouses that holds objects that are being evaluated at different times...
Definition: ExecStore.h:31
Object is evaluated at the beginning of every time step.
Definition: MooseTypes.h:102
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
Object is evaluated in every jacobian computation.
Definition: MooseTypes.h:98