https://mooseframework.inl.gov
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
GatherRCDataFaceThread< RangeType > Class Template Reference

A class that gathers 'a' coefficient data from flux kernels, boundary conditions, and interface kernels contributing to the Navier-Stokes momentum residuals. More...

#include <GatherRCDataFaceThread.h>

Inheritance diagram for GatherRCDataFaceThread< RangeType >:
[legend]

Public Types

using Parent = ThreadedFaceLoop< RangeType >
 

Public Member Functions

 GatherRCDataFaceThread (FEProblemBase &fe_problem, const unsigned int nl_sys_number, const std::vector< unsigned int > &vars, bool on_displaced)
 
 GatherRCDataFaceThread (GatherRCDataFaceThread &x, Threads::split split)
 
void onFace (const FaceInfo &fi) override final
 
void onBoundary (const FaceInfo &fi, BoundaryID boundary) override final
 
void subdomainChanged () override final
 
void neighborSubdomainChanged () override final
 
void join (const ThreadedFaceLoop &y)
 
virtual void operator() (const RangeType &range, bool bypass_threading=false)
 
void join (const ThreadedFaceLoop &y)
 
virtual void postFace (const FaceInfo &)
 
virtual void pre ()
 
virtual void post ()
 
void caughtMooseException (MooseException &e)
 

Protected Member Functions

virtual void printGeneralExecutionInformation () const
 
virtual void printBlockExecutionInformation () const
 
virtual void printBoundaryExecutionInformation (const BoundaryID) const
 
void resetExecutionPrinting ()
 

Protected Attributes

FEProblemBase_fe_problem
 
MooseMesh_mesh
 
const std::set< TagID > & _tags
 
THREAD_ID _tid
 
const unsigned int _nl_system_num
 
const bool _on_displaced
 
SubProblem_subproblem
 
SubdomainID _subdomain
 
SubdomainID _old_subdomain
 
SubdomainID _neighbor_subdomain
 
SubdomainID _old_neighbor_subdomain
 
std::set< std::pair< const SubdomainID, const SubdomainID > > _blocks_exec_printed
 
std::set< BoundaryID_boundaries_exec_printed
 
std::string _error_message
 

Private Member Functions

void finalizeContainers ()
 Called at the end of either subdomainChanged or neighborSubdomainChanged, this method computes the final _fv_flux_kernels set. More...
 
template<typename... Attribs>
void getVarROs (std::vector< INSFVMomentumResidualObject *> &ros, TheWarehouse::QueryCache< Attribs... > &queries)
 This determines all the momentum residual objects for all the variables. More...
 

Private Attributes

const std::vector< unsigned int > & _vars
 The velocity variable numbers. More...
 
std::set< INSFVMomentumResidualObject * > _fv_flux_kernels
 The collection of flux kernels that contribute to the momentum equation residuals. More...
 
std::set< INSFVMomentumResidualObject * > _elem_sub_fv_flux_kernels
 The subset of flux kernels that contribute to the momentum equation residual from the element side of the face. More...
 
std::set< INSFVMomentumResidualObject * > _neigh_sub_fv_flux_kernels
 The subset of flux kernels that contribute to the momentum equation residual from the neighbor side of the face. More...
 

Detailed Description

template<typename RangeType>
class GatherRCDataFaceThread< RangeType >

A class that gathers 'a' coefficient data from flux kernels, boundary conditions, and interface kernels contributing to the Navier-Stokes momentum residuals.

We loop over each active, local face and call the gatherRCData method on each kernel with the current face as an argument

Definition at line 23 of file GatherRCDataFaceThread.h.

Member Typedef Documentation

◆ Parent

template<typename RangeType>
using GatherRCDataFaceThread< RangeType >::Parent = ThreadedFaceLoop<RangeType>

Definition at line 26 of file GatherRCDataFaceThread.h.

Constructor & Destructor Documentation

◆ GatherRCDataFaceThread() [1/2]

template<typename RangeType >
GatherRCDataFaceThread< RangeType >::GatherRCDataFaceThread ( FEProblemBase fe_problem,
const unsigned int  nl_sys_number,
const std::vector< unsigned int > &  vars,
bool  on_displaced 
)

Definition at line 75 of file GatherRCDataFaceThread.h.

79  : ThreadedFaceLoop<RangeType>(fe_problem, nl_sys_number, {}, on_displaced), _vars(vars)
80 {
81 }
const std::vector< unsigned int > & _vars
The velocity variable numbers.

◆ GatherRCDataFaceThread() [2/2]

template<typename RangeType >
GatherRCDataFaceThread< RangeType >::GatherRCDataFaceThread ( GatherRCDataFaceThread< RangeType > &  x,
Threads::split  split 
)

Definition at line 84 of file GatherRCDataFaceThread.h.

87 {
88 }
const std::vector< unsigned int > & _vars
The velocity variable numbers.
const std::vector< double > x
tbb::split split

Member Function Documentation

◆ finalizeContainers()

template<typename RangeType >
void GatherRCDataFaceThread< RangeType >::finalizeContainers ( )
private

Called at the end of either subdomainChanged or neighborSubdomainChanged, this method computes the final _fv_flux_kernels set.

Definition at line 214 of file GatherRCDataFaceThread.h.

215 {
216  const bool same_kernels = _elem_sub_fv_flux_kernels == _neigh_sub_fv_flux_kernels;
217  if (same_kernels)
219  else
220  std::set_union(_elem_sub_fv_flux_kernels.begin(),
224  std::inserter(_fv_flux_kernels, _fv_flux_kernels.begin()));
225 }
std::set< INSFVMomentumResidualObject * > _fv_flux_kernels
The collection of flux kernels that contribute to the momentum equation residuals.
std::set< INSFVMomentumResidualObject * > _elem_sub_fv_flux_kernels
The subset of flux kernels that contribute to the momentum equation residual from the element side of...
std::set< INSFVMomentumResidualObject * > _neigh_sub_fv_flux_kernels
The subset of flux kernels that contribute to the momentum equation residual from the neighbor side o...

◆ getVarROs()

template<typename RangeType >
template<typename... Attribs>
void GatherRCDataFaceThread< RangeType >::getVarROs ( std::vector< INSFVMomentumResidualObject *> &  ros,
TheWarehouse::QueryCache< Attribs... > &  queries 
)
private

This determines all the momentum residual objects for all the variables.

Parameters
rosThe output of this method; all the momentum residual objects for all the variables
queriesCandidate MooseObjects for momentum residual object consideration that have been pre-filtered based on attributes such as thread ID, boundary ID, subdomain ID, etc.

Definition at line 93 of file GatherRCDataFaceThread.h.

95 {
96  for (const auto var_num : _vars)
97  {
98  // We don't want to do cascading var num attributes or else the second time around we won't get
99  // any results out of the query (e.g. an object cannot have a variable that simultaneously has
100  // both var number 0 and 1)
101  auto copied_queries = queries;
102  std::vector<INSFVMomentumResidualObject *> var_ros;
103  copied_queries.template condition<AttribVar>(static_cast<int>(var_num)).queryInto(var_ros);
104  for (auto * const var_ro : var_ros)
105  ros.push_back(var_ro);
106  }
107 }
std::vector< T *> & queryInto(std::vector< T * > &results, Args &&... args)
const std::vector< unsigned int > & _vars
The velocity variable numbers.

◆ join()

template<typename RangeType>
void ThreadedFaceLoop< RangeType >::join

◆ neighborSubdomainChanged()

template<typename RangeType >
void GatherRCDataFaceThread< RangeType >::neighborSubdomainChanged ( )
finaloverridevirtual

Reimplemented from ThreadedFaceLoop< RangeType >.

Definition at line 186 of file GatherRCDataFaceThread.h.

187 {
189 
190  // Clear kernels
191  _fv_flux_kernels.clear();
193 
194  std::vector<INSFVMomentumResidualObject *> kernels;
195  // cannot bind to lvalue reference otherwise the temporary is destroyed and we are left with a
196  // dangling reference
197  auto queries = this->_fe_problem.theWarehouse()
198  .query()
199  .template condition<AttribSysNum>(this->_nl_system_num)
200  .template condition<AttribSystem>("FVFluxKernel")
201  .template condition<AttribDisplaced>(this->_on_displaced)
202  .template condition<AttribSubdomains>(this->_neighbor_subdomain)
203  .template condition<AttribThread>(this->_tid);
204  getVarROs(kernels, queries);
205 
207  std::set<INSFVMomentumResidualObject *>(kernels.begin(), kernels.end());
208 
210 }
void getVarROs(std::vector< INSFVMomentumResidualObject *> &ros, TheWarehouse::QueryCache< Attribs... > &queries)
This determines all the momentum residual objects for all the variables.
const unsigned int _nl_system_num
FEProblemBase & _fe_problem
std::set< INSFVMomentumResidualObject * > _fv_flux_kernels
The collection of flux kernels that contribute to the momentum equation residuals.
SubdomainID _neighbor_subdomain
virtual void neighborSubdomainChanged()
void finalizeContainers()
Called at the end of either subdomainChanged or neighborSubdomainChanged, this method computes the fi...
TheWarehouse & theWarehouse() const
Query query()
const bool _on_displaced
std::set< INSFVMomentumResidualObject * > _neigh_sub_fv_flux_kernels
The subset of flux kernels that contribute to the momentum equation residual from the neighbor side o...

◆ onBoundary()

template<typename RangeType >
void GatherRCDataFaceThread< RangeType >::onBoundary ( const FaceInfo fi,
BoundaryID  boundary 
)
finaloverridevirtual

Implements ThreadedFaceLoop< RangeType >.

Definition at line 119 of file GatherRCDataFaceThread.h.

120 {
121  {
122  std::vector<INSFVMomentumResidualObject *> bcs;
123  // cannot bind to lvalue reference otherwise the temporary is destroyed and we are left with a
124  // dangling reference
125  auto queries = this->_fe_problem.theWarehouse()
126  .query()
127  .template condition<AttribSystem>("FVFluxBC")
128  .template condition<AttribSysNum>(this->_nl_system_num)
129  .template condition<AttribDisplaced>(this->_on_displaced)
130  .template condition<AttribThread>(this->_tid)
131  .template condition<AttribBoundaries>(bnd_id);
132  getVarROs(bcs, queries);
133 
134  for (auto * const bc : bcs)
135  bc->gatherRCData(fi);
136  }
137 
138  {
139  std::vector<INSFVMomentumResidualObject *> iks;
140  // cannot bind to lvalue reference otherwise the temporary is destroyed and we are left with a
141  // dangling reference
142  auto queries = this->_fe_problem.theWarehouse()
143  .query()
144  .template condition<AttribSystem>("FVInterfaceKernel")
145  .template condition<AttribSysNum>(this->_nl_system_num)
146  .template condition<AttribDisplaced>(this->_on_displaced)
147  .template condition<AttribThread>(this->_tid)
148  .template condition<AttribBoundaries>(bnd_id);
149  getVarROs(iks, queries);
150 
151  for (auto * const ik : iks)
152  ik->gatherRCData(fi);
153  }
154 }
void getVarROs(std::vector< INSFVMomentumResidualObject *> &ros, TheWarehouse::QueryCache< Attribs... > &queries)
This determines all the momentum residual objects for all the variables.
const unsigned int _nl_system_num
FEProblemBase & _fe_problem
TheWarehouse & theWarehouse() const
Query query()
const bool _on_displaced

◆ onFace()

template<typename RangeType >
void GatherRCDataFaceThread< RangeType >::onFace ( const FaceInfo fi)
finaloverridevirtual

Implements ThreadedFaceLoop< RangeType >.

Definition at line 111 of file GatherRCDataFaceThread.h.

112 {
113  for (auto * const k : _fv_flux_kernels)
114  k->gatherRCData(fi);
115 }
std::set< INSFVMomentumResidualObject * > _fv_flux_kernels
The collection of flux kernels that contribute to the momentum equation residuals.
static const std::string k
Definition: NS.h:130

◆ subdomainChanged()

template<typename RangeType >
void GatherRCDataFaceThread< RangeType >::subdomainChanged ( )
finaloverridevirtual

Reimplemented from ThreadedFaceLoop< RangeType >.

Definition at line 158 of file GatherRCDataFaceThread.h.

159 {
161 
162  // Clear kernels
163  _fv_flux_kernels.clear();
165 
166  std::vector<INSFVMomentumResidualObject *> kernels;
167  // cannot bind to lvalue reference otherwise the temporary is destroyed and we are left with a
168  // dangling reference
169  auto queries = this->_fe_problem.theWarehouse()
170  .query()
171  .template condition<AttribSysNum>(this->_nl_system_num)
172  .template condition<AttribSystem>("FVFluxKernel")
173  .template condition<AttribDisplaced>(this->_on_displaced)
174  .template condition<AttribSubdomains>(this->_subdomain)
175  .template condition<AttribThread>(this->_tid);
176  getVarROs(kernels, queries);
177 
179  std::set<INSFVMomentumResidualObject *>(kernels.begin(), kernels.end());
180 
182 }
void getVarROs(std::vector< INSFVMomentumResidualObject *> &ros, TheWarehouse::QueryCache< Attribs... > &queries)
This determines all the momentum residual objects for all the variables.
const unsigned int _nl_system_num
FEProblemBase & _fe_problem
SubdomainID _subdomain
std::set< INSFVMomentumResidualObject * > _fv_flux_kernels
The collection of flux kernels that contribute to the momentum equation residuals.
std::set< INSFVMomentumResidualObject * > _elem_sub_fv_flux_kernels
The subset of flux kernels that contribute to the momentum equation residual from the element side of...
void finalizeContainers()
Called at the end of either subdomainChanged or neighborSubdomainChanged, this method computes the fi...
TheWarehouse & theWarehouse() const
Query query()
virtual void subdomainChanged()
const bool _on_displaced

Member Data Documentation

◆ _elem_sub_fv_flux_kernels

template<typename RangeType>
std::set<INSFVMomentumResidualObject *> GatherRCDataFaceThread< RangeType >::_elem_sub_fv_flux_kernels
private

The subset of flux kernels that contribute to the momentum equation residual from the element side of the face.

Definition at line 67 of file GatherRCDataFaceThread.h.

◆ _fv_flux_kernels

template<typename RangeType>
std::set<INSFVMomentumResidualObject *> GatherRCDataFaceThread< RangeType >::_fv_flux_kernels
private

The collection of flux kernels that contribute to the momentum equation residuals.

Definition at line 63 of file GatherRCDataFaceThread.h.

◆ _neigh_sub_fv_flux_kernels

template<typename RangeType>
std::set<INSFVMomentumResidualObject *> GatherRCDataFaceThread< RangeType >::_neigh_sub_fv_flux_kernels
private

The subset of flux kernels that contribute to the momentum equation residual from the neighbor side of the face.

Definition at line 71 of file GatherRCDataFaceThread.h.

◆ _vars

template<typename RangeType>
const std::vector<unsigned int>& GatherRCDataFaceThread< RangeType >::_vars
private

The velocity variable numbers.

Definition at line 60 of file GatherRCDataFaceThread.h.


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