www.mooseframework.org
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
VectorPostprocessorData Class Reference

#include <VectorPostprocessorData.h>

Inheritance diagram for VectorPostprocessorData:
[legend]

Classes

struct  VectorPostprocessorState
 VectorPostprocessorState (2 containers for values (see MooseTypes.h) More...
 
struct  VectorPostprocessorVectors
 Vector of pairs representing the declared vectors (vector name, vector DS) The vector DS is a data structure containing a current and old container (vector of Reals) More...
 

Public Member Functions

 VectorPostprocessorData (FEProblemBase &fe_problem)
 Class constructor. More...
 
void init (const std::string &name)
 Initialization method, sets the current and old value to 0.0 for this postprocessor. More...
 
VectorPostprocessorValuedeclareVector (const std::string &vpp_name, const std::string &vector_name, bool contains_complete_history, bool is_broadcast)
 Initialization method, sets the current and old value to 0.0 for this VectorPostprocessor. More...
 
bool hasVectorPostprocessor (const std::string &name)
 Returns a true value if the VectorPostprocessor exists. More...
 
VectorPostprocessorValuegetVectorPostprocessorValue (const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool needs_broadcast)
 Return the value for the post processor. More...
 
VectorPostprocessorValuegetVectorPostprocessorValueOld (const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool needs_broadcast)
 The the old value of an post-processor. More...
 
ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const VectorPostprocessorName &vpp_name, const std::string &vector_name)
 Return the scatter value for the post processor. More...
 
ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const VectorPostprocessorName &vpp_name, const std::string &vector_name)
 Return the scatter value for the post processor. More...
 
bool hasVectors (const std::string &vpp_name) const
 Check to see if a VPP has any vectors at all. More...
 
bool containsCompleteHistory (const std::string &name) const
 Returns a Boolean indicating whether the specified VPP vectors contain complete history. More...
 
const std::vector< std::pair< std::string, VectorPostprocessorState > > & vectors (const std::string &vpp_name) const
 Get the map of vectors for a particular VectorPostprocessor. More...
 
void broadcastScatterVectors (const std::string &vpp_name)
 Broadcast and scatter vectors associated with vpp_name. More...
 
void copyValuesBack ()
 Copy the current post-processor values into old (i.e. More...
 

Protected Member Functions

template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRecoverableData (std::string data_name)
 Declare a piece of data as "recoverable". More...
 
template<typename T >
T & declareRecoverableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithObjectName (std::string data_name, std::string object_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithObjectNameWithContext (std::string data_name, std::string object_name, void *context)
 Declare a piece of data as "restartable". More...
 

Private Member Functions

VectorPostprocessorStategetVectorPostprocessorHelper (const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool get_current=true, bool contains_complete_history=false, bool is_broadcast=false, bool needs_broadcast=false, bool needs_scatter=false)
 

Private Attributes

std::map< std::string, VectorPostprocessorVectors_vpp_data
 The VPP data store in a map: VPP Name to vector storage. More...
 
std::set< std::string > _requested_items
 
std::set< std::string > _supplied_items
 

Detailed Description

Definition at line 25 of file VectorPostprocessorData.h.

Constructor & Destructor Documentation

◆ VectorPostprocessorData()

VectorPostprocessorData::VectorPostprocessorData ( FEProblemBase fe_problem)

Class constructor.

Definition at line 13 of file VectorPostprocessorData.C.

14  : Restartable(fe_problem.getMooseApp(), "values", "VectorPostprocessorData", 0),
15  ParallelObject(fe_problem)
16 {
17 }
Restartable(const MooseObject *moose_object, const std::string &system_name)
Class constructor.
Definition: Restartable.C:17
MooseApp & getMooseApp() const
Get the MooseApp this object is associated with.
Definition: MooseObject.h:86

Member Function Documentation

◆ broadcastScatterVectors()

void VectorPostprocessorData::broadcastScatterVectors ( const std::string &  vpp_name)

Broadcast and scatter vectors associated with vpp_name.

Parameters
vpp_nameThe name of the vector to broadcast/scatter vectors for

Definition at line 209 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::joinAndFinalize().

210 {
211  auto vpp_data_it = _vpp_data.find(vpp_name);
212 
213  if (vpp_data_it == _vpp_data.end())
214  mooseError("Unable to find VPP Data for ", vpp_name);
215 
216  auto & vpp_vectors = vpp_data_it->second;
217 
218  for (auto & current_pair : vpp_vectors._values)
219  {
220  auto & vpp_state = current_pair.second;
221 
222  if (!vpp_vectors._is_broadcast && vpp_state.needs_broadcast)
223  {
224  auto size = vpp_state.current->size();
225 
226  _communicator.broadcast(size);
227  vpp_state.current->resize(size);
228  _communicator.broadcast(*vpp_state.current);
229  }
230 
231  if (vpp_state.needs_scatter)
232  _communicator.scatter(*vpp_state.current, vpp_state.scatter_current);
233  }
234 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, VectorPostprocessorVectors > _vpp_data
The VPP data store in a map: VPP Name to vector storage.

◆ containsCompleteHistory()

bool VectorPostprocessorData::containsCompleteHistory ( const std::string &  name) const

Returns a Boolean indicating whether the specified VPP vectors contain complete history.

Definition at line 25 of file VectorPostprocessorData.C.

Referenced by CSV::output().

26 {
27  auto it = _vpp_data.find(name);
28  mooseAssert(it != _vpp_data.end(), std::string("VectorPostprocessor ") + name + " not found!");
29 
30  return it->second._contains_complete_history;
31 }
std::map< std::string, VectorPostprocessorVectors > _vpp_data
The VPP data store in a map: VPP Name to vector storage.

◆ copyValuesBack()

void VectorPostprocessorData::copyValuesBack ( )

Copy the current post-processor values into old (i.e.

shift it "back in time") as needed

Depending on the needs of this VPP, we'll perform different actions on the vectors as time is advanced.

Need Old | Preserve History | Action

False | False | None False | True | None True | False | Swap True | True | Copy

Definition at line 237 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::advanceState().

238 {
250  for (auto & vec_pair : _vpp_data)
251  {
252  bool needs_old = vec_pair.second._needs_old;
253  bool preserve_history = vec_pair.second._contains_complete_history;
254 
255  if (!needs_old)
256  continue;
257 
258  for (auto & vec_it : vec_pair.second._values)
259  {
260  if (preserve_history)
261  *vec_it.second.old = *vec_it.second.current;
262  else
263  vec_it.second.old->swap(*vec_it.second.current);
264 
265  vec_it.second.scatter_old = vec_it.second.scatter_current;
266  }
267  }
268 }
std::map< std::string, VectorPostprocessorVectors > _vpp_data
The VPP data store in a map: VPP Name to vector storage.

◆ declareRecoverableData() [1/2]

template<typename T >
T & Restartable::declareRecoverableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "recoverable".

This means that in the event of a recovery this piece of data will be restored back to its previous value.

Note - this data will NOT be restored on Restart!

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 269 of file Restartable.h.

270 {
271  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
272 
273  registerRecoverableDataOnApp(full_name);
274 
275  return declareRestartableDataWithContext<T>(data_name, nullptr);
276 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
void registerRecoverableDataOnApp(std::string name)
Helper function for actually registering the restartable data.
Definition: Restartable.C:54

◆ declareRecoverableData() [2/2]

template<typename T >
T & Restartable::declareRecoverableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

Note - this data will NOT be restored on Restart!

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 280 of file Restartable.h.

281 {
282  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
283 
284  registerRecoverableDataOnApp(full_name);
285 
286  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
287 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
void registerRecoverableDataOnApp(std::string name)
Helper function for actually registering the restartable data.
Definition: Restartable.C:54

◆ declareRestartableData() [1/2]

template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 202 of file Restartable.h.

203 {
204  return declareRestartableDataWithContext<T>(data_name, nullptr);
205 }

◆ declareRestartableData() [2/2]

template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 209 of file Restartable.h.

210 {
211  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
212 }

◆ declareRestartableDataWithContext() [1/2]

template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 216 of file Restartable.h.

217 {
218  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
219  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
220  T & restartable_data_ref = data_ptr->get();
221 
222  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
223 
224  return restartable_data_ref;
225 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:197
void registerRestartableDataOnApp(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Helper function for actually registering the restartable data.
Definition: Restartable.C:46

◆ declareRestartableDataWithContext() [2/2]

template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 229 of file Restartable.h.

232 {
233  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
234  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
235  data_ptr->set() = init_value;
236 
237  T & restartable_data_ref = data_ptr->get();
238  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
239 
240  return restartable_data_ref;
241 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:194
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:197
void registerRestartableDataOnApp(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Helper function for actually registering the restartable data.
Definition: Restartable.C:46

◆ declareRestartableDataWithObjectName()

template<typename T >
T & Restartable::declareRestartableDataWithObjectName ( std::string  data_name,
std::string  object_name 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
object_nameA supplied name for the object that is declaring this data.

Definition at line 245 of file Restartable.h.

246 {
247  return declareRestartableDataWithObjectNameWithContext<T>(data_name, object_name, nullptr);
248 }

◆ declareRestartableDataWithObjectNameWithContext()

template<typename T >
T & Restartable::declareRestartableDataWithObjectNameWithContext ( std::string  data_name,
std::string  object_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
object_nameA supplied name for the object that is declaring this data.
contextContext pointer that will be passed to the load and store functions

Definition at line 252 of file Restartable.h.

255 {
256  std::string old_name = _restartable_name;
257 
258  _restartable_name = object_name;
259 
260  T & value = declareRestartableDataWithContext<T>(data_name, context);
261 
262  _restartable_name = old_name;
263 
264  return value;
265 }
std::string _restartable_name
The name of the object.
Definition: Restartable.h:191

◆ declareVector()

VectorPostprocessorValue & VectorPostprocessorData::declareVector ( const std::string &  vpp_name,
const std::string &  vector_name,
bool  contains_complete_history,
bool  is_broadcast 
)

Initialization method, sets the current and old value to 0.0 for this VectorPostprocessor.

Parameters
vpp_nameThe name of the VectorPostprocessor
vector_nameThe name of the vector
contains_complete_historyTrue if the vector will naturally contain the complete time history of the values
is_broadcastTrue if the vector will already be replicated by the VPP. This prevents unnecessary broadcasting by MOOSE.

Definition at line 118 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::declareVectorPostprocessorVector().

122 {
123  _supplied_items.emplace(vpp_name + "::" + vector_name);
124 
125  auto & vec_struct = getVectorPostprocessorHelper(
126  vpp_name, vector_name, true, contains_complete_history, is_broadcast);
127 
128  return *vec_struct.current;
129 }
VectorPostprocessorState & getVectorPostprocessorHelper(const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool get_current=true, bool contains_complete_history=false, bool is_broadcast=false, bool needs_broadcast=false, bool needs_scatter=false)
std::set< std::string > _supplied_items

◆ getScatterVectorPostprocessorValue()

ScatterVectorPostprocessorValue & VectorPostprocessorData::getScatterVectorPostprocessorValue ( const VectorPostprocessorName &  vpp_name,
const std::string &  vector_name 
)

Return the scatter value for the post processor.

Parameters
vpp_nameThe name of the VectorPostprocessor
vector_nameThe name of the vector
Returns
The reference to the current scatter value

Definition at line 78 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::getScatterVectorPostprocessorValue().

80 {
81  _requested_items.emplace(vpp_name + "::" + vector_name);
82 
83  // Note: the "false" parameters here are just dummies. They will not change the value of
84  // these booleans in the structs because they are or-equaled (|=) in
85  // The "true" is to turn on scatter
86  auto & vec_struct = getVectorPostprocessorHelper(vpp_name,
87  vector_name,
88  /* get_current */ true,
89  /* contains_complete_history */ false,
90  /* is_broadcast */ false,
91  /* needs_broadcast */ false,
92  /* needs_scatter */ true);
93 
94  return vec_struct.scatter_current;
95 }
std::set< std::string > _requested_items
VectorPostprocessorState & getVectorPostprocessorHelper(const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool get_current=true, bool contains_complete_history=false, bool is_broadcast=false, bool needs_broadcast=false, bool needs_scatter=false)

◆ getScatterVectorPostprocessorValueOld()

ScatterVectorPostprocessorValue & VectorPostprocessorData::getScatterVectorPostprocessorValueOld ( const VectorPostprocessorName &  vpp_name,
const std::string &  vector_name 
)

Return the scatter value for the post processor.

Parameters
vpp_nameThe name of the VectorPostprocessor
vector_nameThe name of the vector
Returns
The reference to the old scatter value

Definition at line 98 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::getScatterVectorPostprocessorValueOld().

100 {
101  _requested_items.emplace(vpp_name + "::" + vector_name);
102 
103  // Note: the "false" parameters here are just dummies. They will not change the value of
104  // these booleans in the structs because they are or-equaled (|=) in
105  // The "true" is to turn on scatter
106  auto & vec_struct = getVectorPostprocessorHelper(vpp_name,
107  vector_name,
108  /* get_current */ false,
109  /* contains_complete_history */ false,
110  /* is_broadcast */ false,
111  /* needs_broadcast */ false,
112  /* needs_scatter */ true);
113 
114  return vec_struct.scatter_old;
115 }
std::set< std::string > _requested_items
VectorPostprocessorState & getVectorPostprocessorHelper(const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool get_current=true, bool contains_complete_history=false, bool is_broadcast=false, bool needs_broadcast=false, bool needs_scatter=false)

◆ getVectorPostprocessorHelper()

VectorPostprocessorData::VectorPostprocessorState & VectorPostprocessorData::getVectorPostprocessorHelper ( const VectorPostprocessorName &  vpp_name,
const std::string &  vector_name,
bool  get_current = true,
bool  contains_complete_history = false,
bool  is_broadcast = false,
bool  needs_broadcast = false,
bool  needs_scatter = false 
)
private

Definition at line 132 of file VectorPostprocessorData.C.

Referenced by declareVector(), getScatterVectorPostprocessorValue(), getScatterVectorPostprocessorValueOld(), getVectorPostprocessorValue(), and getVectorPostprocessorValueOld().

139 {
140  // Retrieve or create the data structure for this VPP
141  auto vec_it_pair = _vpp_data.emplace(
142  std::piecewise_construct, std::forward_as_tuple(vpp_name), std::forward_as_tuple());
143  auto & vec_storage = vec_it_pair.first->second;
144 
145  // If the VPP is declaring a vector, see if complete history is needed. Note: This parameter
146  // is constant and applies to _all_ declared vectors.
147  vec_storage._contains_complete_history |= contains_complete_history;
148 
149  // If the VPP is declaring a vector, see if it will already be replicated in parallel.
150  // Note: This parameter is constant and applies to _all_ declared vectors.
151  vec_storage._is_broadcast |= is_broadcast;
152 
153  // Keep track of whether an old vector is needed for copying back later.
154  if (!get_current)
155  vec_storage._needs_old = true;
156 
157  // lambda for doing comparison on name (i.e., first item in pair)
158  auto comp = [&vector_name](std::pair<std::string, VectorPostprocessorState> & pair) {
159  return pair.first == vector_name;
160  };
161  // Search for the vector, if it is not located create the entry in the storage
162  auto iter = std::find_if(vec_storage._values.rbegin(), vec_storage._values.rend(), comp);
163  if (iter == vec_storage._values.rend())
164  {
165  vec_storage._values.emplace_back(
166  std::piecewise_construct, std::forward_as_tuple(vector_name), std::forward_as_tuple());
167  iter = vec_storage._values.rbegin();
168  }
169 
170  auto & vec_struct = iter->second;
171  if (!vec_struct.current)
172  {
173  mooseAssert(!vec_struct.old, "Uninitialized pointers in VectorPostprocessor Data");
174  vec_struct.current = &declareRestartableDataWithObjectName<VectorPostprocessorValue>(
175  vpp_name + "_" + vector_name, "values");
176  vec_struct.old = &declareRestartableDataWithObjectName<VectorPostprocessorValue>(
177  vpp_name + "_" + vector_name, "values_old");
178  }
179 
180  // Does the VPP need to be broadcast after computing
181  vec_struct.needs_broadcast |= needs_broadcast;
182 
183  // Does the VPP need to be scattered after computing
184  vec_struct.needs_scatter |= needs_scatter;
185 
186  return vec_struct;
187 }
std::map< std::string, VectorPostprocessorVectors > _vpp_data
The VPP data store in a map: VPP Name to vector storage.

◆ getVectorPostprocessorValue()

VectorPostprocessorValue & VectorPostprocessorData::getVectorPostprocessorValue ( const VectorPostprocessorName &  vpp_name,
const std::string &  vector_name,
bool  needs_broadcast 
)

Return the value for the post processor.

Parameters
vpp_nameThe name of the VectorPostprocessor
vector_nameThe name of the vector
needs_broadcastWhether or not the vector needs to be broadcast
Returns
The reference to the current value

Definition at line 40 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::getVectorPostprocessorValue().

43 {
44  _requested_items.emplace(vpp_name + "::" + vector_name);
45 
46  // Note: the "false" parameters here are just dummies. They will not change the value of
47  // these booleans in the structs because they are or-equaled (|=) in
48  auto & vec_struct = getVectorPostprocessorHelper(vpp_name,
49  vector_name,
50  /* get_current */ true,
51  /* contains_complete_history */ false,
52  /* is_broadcast */ false,
53  /* needs_broadcast */ needs_broadcast,
54  /* needs_scatter */ false);
55  return *vec_struct.current;
56 }
std::set< std::string > _requested_items
VectorPostprocessorState & getVectorPostprocessorHelper(const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool get_current=true, bool contains_complete_history=false, bool is_broadcast=false, bool needs_broadcast=false, bool needs_scatter=false)

◆ getVectorPostprocessorValueOld()

VectorPostprocessorValue & VectorPostprocessorData::getVectorPostprocessorValueOld ( const VectorPostprocessorName &  vpp_name,
const std::string &  vector_name,
bool  needs_broadcast 
)

The the old value of an post-processor.

Parameters
vpp_nameThe name of the VectorPostprocessor
vector_nameThe name of the vector
needs_broadcastWhether or not the vector needs to be broadcast
Returns
The reference to the old value

Definition at line 59 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::getVectorPostprocessorValueOld().

62 {
63  _requested_items.emplace(vpp_name + "::" + vector_name);
64 
65  // Note: the "false" parameters here are just dummies. They will not change the value of
66  // these booleans in the structs because they are or-equaled (|=) in
67  auto & vec_struct = getVectorPostprocessorHelper(vpp_name,
68  vector_name,
69  /* get_current */ false,
70  /* contains_complete_history */ false,
71  /* is_broadcast */ false,
72  /* needs_broadcast */ needs_broadcast,
73  /* needs_scatter */ false);
74  return *vec_struct.old;
75 }
std::set< std::string > _requested_items
VectorPostprocessorState & getVectorPostprocessorHelper(const VectorPostprocessorName &vpp_name, const std::string &vector_name, bool get_current=true, bool contains_complete_history=false, bool is_broadcast=false, bool needs_broadcast=false, bool needs_scatter=false)

◆ hasVectorPostprocessor()

bool VectorPostprocessorData::hasVectorPostprocessor ( const std::string &  name)

Returns a true value if the VectorPostprocessor exists.

Definition at line 34 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::hasVectorPostprocessor().

35 {
36  return (_vpp_data.find(name) != _vpp_data.end());
37 }
std::map< std::string, VectorPostprocessorVectors > _vpp_data
The VPP data store in a map: VPP Name to vector storage.

◆ hasVectors()

bool VectorPostprocessorData::hasVectors ( const std::string &  vpp_name) const

Check to see if a VPP has any vectors at all.

Definition at line 190 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::vectorPostprocessorHasVectors().

191 {
192  auto it_pair = _vpp_data.find(vpp_name);
193  if (it_pair != _vpp_data.end())
194  return !it_pair->second._values.empty();
195 
196  return false;
197 }
std::map< std::string, VectorPostprocessorVectors > _vpp_data
The VPP data store in a map: VPP Name to vector storage.

◆ init()

void VectorPostprocessorData::init ( const std::string &  name)

Initialization method, sets the current and old value to 0.0 for this postprocessor.

Definition at line 20 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::initVectorPostprocessorData().

21 {
22 }

◆ vectors()

const std::vector< std::pair< std::string, VectorPostprocessorData::VectorPostprocessorState > > & VectorPostprocessorData::vectors ( const std::string &  vpp_name) const

Get the map of vectors for a particular VectorPostprocessor.

Parameters
vpp_nameThe name of the VectorPostprocessor

Definition at line 200 of file VectorPostprocessorData.C.

Referenced by FEProblemBase::getVectorPostprocessorVectors().

201 {
202  auto it_pair = _vpp_data.find(vpp_name);
203  mooseAssert(it_pair != _vpp_data.end(), "No vectors found for vpp_name: " << vpp_name);
204 
205  return it_pair->second._values;
206 }
std::map< std::string, VectorPostprocessorVectors > _vpp_data
The VPP data store in a map: VPP Name to vector storage.

Member Data Documentation

◆ _requested_items

std::set<std::string> VectorPostprocessorData::_requested_items
private

◆ _supplied_items

std::set<std::string> VectorPostprocessorData::_supplied_items
private

Definition at line 185 of file VectorPostprocessorData.h.

Referenced by declareVector().

◆ _vpp_data

std::map<std::string, VectorPostprocessorVectors> VectorPostprocessorData::_vpp_data
private

The VPP data store in a map: VPP Name to vector storage.

Definition at line 182 of file VectorPostprocessorData.h.

Referenced by broadcastScatterVectors(), containsCompleteHistory(), copyValuesBack(), getVectorPostprocessorHelper(), hasVectorPostprocessor(), hasVectors(), and vectors().


The documentation for this class was generated from the following files: