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

#include <ComputeFVFluxThread.h>

Inheritance diagram for ComputeFVFluxResidualThread< RangeType >:
[legend]

Public Member Functions

 ComputeFVFluxResidualThread (FEProblemBase &fe_problem, const unsigned int nl_system_num, const std::set< TagID > &tags, bool on_displaced)
 
 ComputeFVFluxResidualThread (ComputeFVFluxResidualThread &x, Threads::split split)
 
virtual void onFace (const FaceInfo &fi) override
 
virtual void pre () override
 This is called once before all face-looping. More...
 
virtual void post () override
 This is called once after all face-looping is finished. More...
 
virtual void onBoundary (const FaceInfo &fi, BoundaryID boundary) override
 This is called once for every face that is on a boundary after onFace is called for the face. More...
 
virtual void subdomainChanged () override
 Called every time the current subdomain changes (i.e. More...
 
virtual void neighborSubdomainChanged () override
 Called every time the neighbor subdomain changes (i.e. More...
 
virtual void operator() (const RangeType &range, bool bypass_threading=false)
 
void join (const ThreadedFaceLoop &y)
 
void caughtMooseException (MooseException &e)
 Called if a MooseException is caught anywhere during the computation. More...
 

Protected Member Functions

void postFace (const FaceInfo &fi) override
 This is called once for each face after all face and boundary callbacks have been finished for that face. More...
 
void compute (FVFaceResidualObject &ro, const FaceInfo &fi) override
 call either computeResidual, computeJacobian, or computeResidualAndJacobian on the provided residual object depending on what derived class of this class is instantiated More...
 
void setup (SetupInterface &obj) override
 call either residualSetup or jacobianSetup depending on what derived class of this class is instantiated More...
 
void addCached () override
 call either addCachedJacobian or addCachedResidual or both depending on what derived class of this class is instantiated More...
 
void resetExecutionPrinting ()
 Reset lists of blocks and boundaries for which execution printing has been done. More...
 

Protected Attributes

unsigned int _num_cached
 
FEProblemBase_fe_problem
 
MooseMesh_mesh
 
const std::set< TagID > & _tags
 
THREAD_ID _tid
 
const unsigned int _nl_system_num
 
const bool _on_displaced
 Whether this loop is operating on the displaced mesh. More...
 
SubProblem_subproblem
 FEProblemBase or DisplacedProblem depending on _on_displaced. More...
 
SubdomainID _subdomain
 The subdomain for the current element. More...
 
SubdomainID _old_subdomain
 The subdomain for the last element. More...
 
SubdomainID _neighbor_subdomain
 The subdomain for the current neighbor. More...
 
SubdomainID _old_neighbor_subdomain
 The subdomain for the last neighbor. More...
 
std::set< std::pair< const SubdomainID, const SubdomainID > > _blocks_exec_printed
 Set to keep track of blocks for which we have printed the execution pattern. More...
 
std::set< BoundaryID_boundaries_exec_printed
 Set to keep track of boundaries for which we have printed the execution pattern. More...
 
std::string _error_message
 Holds caught runtime error messages. More...
 

Detailed Description

template<typename RangeType>
class ComputeFVFluxResidualThread< RangeType >

Definition at line 818 of file ComputeFVFluxThread.h.

Constructor & Destructor Documentation

◆ ComputeFVFluxResidualThread() [1/2]

template<typename RangeType >
ComputeFVFluxResidualThread< RangeType >::ComputeFVFluxResidualThread ( FEProblemBase fe_problem,
const unsigned int  nl_system_num,
const std::set< TagID > &  tags,
bool  on_displaced 
)

Definition at line 842 of file ComputeFVFluxThread.h.

847  : ComputeFVFluxThread<RangeType, AttribVectorTags>(fe_problem, nl_system_num, tags, on_displaced)
848 {
849 }

◆ ComputeFVFluxResidualThread() [2/2]

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

Member Function Documentation

◆ addCached()

template<typename RangeType>
void ComputeFVFluxResidualThread< RangeType >::addCached ( )
inlineoverrideprotectedvirtual

call either addCachedJacobian or addCachedResidual or both depending on what derived class of this class is instantiated

Implements ComputeFVFluxThread< RangeType, AttribVectorTags >.

Definition at line 838 of file ComputeFVFluxThread.h.

838 { this->_subproblem.SubProblem::addCachedResidual(_tid); }
SubProblem & _subproblem
FEProblemBase or DisplacedProblem depending on _on_displaced.

◆ caughtMooseException()

template<typename RangeType>
void ThreadedFaceLoop< RangeType >::caughtMooseException ( MooseException e)
inlineinherited

Called if a MooseException is caught anywhere during the computation.

Definition at line 116 of file ComputeFVFluxThread.h.

117  {
118  Threads::spin_mutex::scoped_lock lock(threaded_element_mutex);
119  std::string what(e.what());
121  }
virtual const char * what() const
Get out the error message.
FEProblemBase & _fe_problem
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
static Threads::spin_mutex threaded_element_mutex
This mutex is used by all derived classes of the ThreadedElementLoop.

◆ compute()

template<typename RangeType>
void ComputeFVFluxResidualThread< RangeType >::compute ( FVFaceResidualObject ro,
const FaceInfo fi 
)
inlineoverrideprotectedvirtual

call either computeResidual, computeJacobian, or computeResidualAndJacobian on the provided residual object depending on what derived class of this class is instantiated

Implements ComputeFVFluxThread< RangeType, AttribVectorTags >.

Definition at line 836 of file ComputeFVFluxThread.h.

836 { ro.computeResidual(fi); }
virtual void computeResidual(const FaceInfo &fi)=0
Compute the residual on the supplied face.

◆ join()

template<typename RangeType >
void ThreadedFaceLoop< RangeType >::join ( const ThreadedFaceLoop< RangeType > &  y)
inherited

Definition at line 227 of file ComputeFVFluxThread.h.

228 {
229  if (_error_message.empty() && !y._error_message.empty())
231 }
std::string _error_message
Holds caught runtime error messages.

◆ neighborSubdomainChanged()

void ComputeFVFluxThread< RangeType, AttribVectorTags >::neighborSubdomainChanged ( )
overridevirtualinherited

Called every time the neighbor subdomain changes (i.e.

the subdomain of this face's neighbor element is not the same as the subdomain of the last face's neighbor element).

Reimplemented from ThreadedFaceLoop< RangeType >.

Definition at line 694 of file ComputeFVFluxThread.h.

695 {
697 
698  // Clear variables
699  _fv_vars.clear();
700  _neigh_sub_fv_vars.clear();
701 
702  // Clear kernels
703  _fv_flux_kernels.clear();
705 
706  // Clear element face materials
707  _elem_face_mats.clear();
709 
710  // Clear neighbor face materials
711  _neigh_face_mats.clear();
713 
714  // TODO: do this for other relevant objects - like FV BCs, FV source term
715  // kernels, etc. - but we don't need to add them for other types of objects
716  // like FE or DG kernels because those kernels don't run in this loop. Do we
717  // really want to integrate fv source kernels into this loop?
718  std::vector<FVFluxKernel *> kernels;
720  .query()
721  .template condition<AttribSysNum>(_nl_system_num)
722  .template condition<AttribSystem>("FVFluxKernel")
723  .template condition<AttribDisplaced>(_on_displaced)
724  .template condition<AttribSubdomains>(_neighbor_subdomain)
725  .template condition<AttribThread>(_tid)
726  .template condition<AttributeTagType>(_tags)
727  .queryInto(kernels);
728 
729  _neigh_sub_fv_flux_kernels = std::set<FVFluxKernel *>(kernels.begin(), kernels.end());
730 
731  for (auto * k : _neigh_sub_fv_flux_kernels)
732  {
733  // TODO: we need a better way to do this - especially when FE objects begin to
734  // couple to FV vars. This code shoud be refactored out into one place
735  // where it is easy for users to say initialize all materials and
736  // variables needed by these objects for me.
737  const auto & deps = k->getMooseVariableDependencies();
738  for (auto var : deps)
739  {
740  mooseAssert(var->isFV(),
741  "We do not currently support coupling of FE variables into FV objects");
742  _neigh_sub_fv_vars.insert(var);
743  }
744  }
745 
750  _tid);
751 
753 }
std::vector< std::shared_ptr< MaterialBase > > _neigh_face_mats
void getFVMatsAndDependencies(SubdomainID block_id, std::vector< std::shared_ptr< MaterialBase >> &face_materials, std::vector< std::shared_ptr< MaterialBase >> &neighbor_materials, std::set< MooseVariableFieldBase *> &variables, const THREAD_ID tid)
Get the materials and variables potentially needed for FV.
const unsigned int _nl_system_num
std::vector< std::shared_ptr< MaterialBase > > _neigh_sub_neigh_face_mats
FEProblemBase & _fe_problem
std::vector< T * > & queryInto(std::vector< T *> &results, Args &&... args)
queryInto executes the query and stores the results in the given vector.
Definition: TheWarehouse.h:311
std::vector< std::shared_ptr< MaterialBase > > _neigh_sub_elem_face_mats
std::set< MooseVariableFieldBase *> _neigh_sub_fv_vars
const std::set< TagID > & _tags
SubdomainID _neighbor_subdomain
The subdomain for the current neighbor.
virtual void neighborSubdomainChanged()
Called every time the neighbor subdomain changes (i.e.
TheWarehouse & theWarehouse() const
std::vector< std::shared_ptr< MaterialBase > > _elem_face_mats
Element face materials.
std::set< FVFluxKernel *> _fv_flux_kernels
FVFluxKernels.
std::set< MooseVariableFieldBase *> _fv_vars
Variables.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:466
const bool _on_displaced
Whether this loop is operating on the displaced mesh.

◆ onBoundary()

void ComputeFVFluxThread< RangeType, AttribVectorTags >::onBoundary ( const FaceInfo fi,
BoundaryID  boundary 
)
overridevirtualinherited

This is called once for every face that is on a boundary after onFace is called for the face.

Implements ThreadedFaceLoop< RangeType >.

Definition at line 530 of file ComputeFVFluxThread.h.

531 {
533  return;
534 
535  std::vector<FVFluxBC *> bcs;
537  .query()
538  .template condition<AttribSysNum>(_nl_system_num)
539  .template condition<AttribSystem>("FVFluxBC")
540  .template condition<AttribDisplaced>(_on_displaced)
541  .template condition<AttribThread>(_tid)
542  .template condition<AttributeTagType>(_tags)
543  .template condition<AttribBoundaries>(bnd_id)
544  .queryInto(bcs);
545 
546  for (auto * const bc : bcs)
547  compute(*bc, fi);
548 
549  std::vector<FVInterfaceKernel *> iks;
551  .query()
552  .template condition<AttribSysNum>(_nl_system_num)
553  .template condition<AttribSystem>("FVInterfaceKernel")
554  .template condition<AttribDisplaced>(_on_displaced)
555  .template condition<AttribThread>(_tid)
556  .template condition<AttributeTagType>(_tags)
557  .template condition<AttribBoundaries>(bnd_id)
558  .queryInto(iks);
559 
560  for (auto * const ik : iks)
561  compute(*ik, fi);
562 }
const unsigned int _nl_system_num
FEProblemBase & _fe_problem
std::vector< T * > & queryInto(std::vector< T *> &results, Args &&... args)
queryInto executes the query and stores the results in the given vector.
Definition: TheWarehouse.h:311
virtual void compute(FVFaceResidualObject &ro, const FaceInfo &fi)=0
call either computeResidual, computeJacobian, or computeResidualAndJacobian on the provided residual ...
const std::set< TagID > & _tags
TheWarehouse & theWarehouse() const
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:466
const bool _on_displaced
Whether this loop is operating on the displaced mesh.

◆ onFace()

void ComputeFVFluxThread< RangeType, AttribVectorTags >::onFace ( const FaceInfo fi)
overridevirtualinherited

Implements ThreadedFaceLoop< RangeType >.

Definition at line 520 of file ComputeFVFluxThread.h.

521 {
522  reinitVariables(fi);
523 
524  for (auto * const k : _fv_flux_kernels)
525  compute(*k, fi);
526 }
virtual void compute(FVFaceResidualObject &ro, const FaceInfo &fi)=0
call either computeResidual, computeJacobian, or computeResidualAndJacobian on the provided residual ...
std::set< FVFluxKernel *> _fv_flux_kernels
FVFluxKernels.

◆ operator()()

template<typename RangeType >
void ThreadedFaceLoop< RangeType >::operator() ( const RangeType &  range,
bool  bypass_threading = false 
)
virtualinherited

Definition at line 241 of file ComputeFVFluxThread.h.

242 {
243  // TODO: make this query fv flux kernel specific or somehow integrate the
244  // fv source kernels into this loop. Also this check will need to increase
245  // in generality if/when other systems and objects besides FV stuff get
246  // added to this loop.
247  std::vector<FVKernel *> kernels;
249  .query()
250  .template condition<AttribSysNum>(_nl_system_num)
251  .template condition<AttribSystem>("FVFluxKernel")
252  .template condition<AttribDisplaced>(_on_displaced)
253  .queryInto(kernels);
254  if (kernels.size() == 0)
255  return;
256 
257  try
258  {
259  try
260  {
261  ParallelUniqueId puid;
262  _tid = bypass_threading ? 0 : puid.id;
263 
264  pre();
266 
269 
270  typename RangeType::const_iterator faceinfo = range.begin();
271  for (faceinfo = range.begin(); faceinfo != range.end(); ++faceinfo)
272  {
273  const Elem & elem = (*faceinfo)->elem();
274 
276 
278  _subdomain = elem.subdomain_id();
279  if (_subdomain != _old_subdomain)
280  {
283  }
284 
286  if (const Elem * const neighbor = (*faceinfo)->neighborPtr())
287  {
289  _neighbor_subdomain = neighbor->subdomain_id();
290  }
291  else
293 
295  {
297  // This is going to cause a lot more printing
299  }
300 
301  onFace(**faceinfo);
302  // Cache data now because onBoundary may clear it. E.g. there was a nasty bug for two
303  // variable FV systems where if one variable was executing an FVFluxKernel on a boundary
304  // while the other was executing an FVFluxBC, the FVFluxKernel data would get lost because
305  // onBoundary would clear the residual/Jacobian data before it was cached
306  postFace(**faceinfo);
307 
308  const std::set<BoundaryID> boundary_ids = (*faceinfo)->boundaryIDs();
309  for (auto & it : boundary_ids)
310  {
312  onBoundary(**faceinfo, it);
313  }
314 
315  postFace(**faceinfo);
316 
317  } // range
318  post();
319 
320  // Clear execution printing sets to start printing on every block and boundary again
322  }
323  catch (MetaPhysicL::LogicError & e)
324  {
326  }
327  catch (std::exception & e)
328  {
329  // Continue if we find a libMesh degenerate map exception, but
330  // just throw for any real error
331  if (!strstr(e.what(), "Jacobian") && !strstr(e.what(), "singular") &&
332  !strstr(e.what(), "det != 0"))
333  throw;
334 
335  mooseException("We caught a libMesh degeneracy exception in ComputeFVFluxThread:\n",
336  e.what());
337  }
338  }
339  catch (MooseException & e)
340  {
342  }
343  catch (std::runtime_error & e)
344  {
345  _error_message = e.what();
346  }
347 }
const unsigned int _nl_system_num
std::string _error_message
Holds caught runtime error messages.
FEProblemBase & _fe_problem
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
Definition: MooseError.C:141
SubdomainID _subdomain
The subdomain for the current element.
virtual void postFace(const FaceInfo &)
This is called once for each face after all face and boundary callbacks have been finished for that f...
void resetExecutionPrinting()
Reset lists of blocks and boundaries for which execution printing has been done.
virtual void post()
This is called once after all face-looping is finished.
virtual void printBoundaryExecutionInformation(const BoundaryID) const
Print ordering of objects exected on each boundary.
SubdomainID _neighbor_subdomain
The subdomain for the current neighbor.
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.C:20
virtual void neighborSubdomainChanged()
Called every time the neighbor subdomain changes (i.e.
virtual void onBoundary(const FaceInfo &fi, BoundaryID boundary)=0
This is called once for every face that is on a boundary after onFace is called for the face...
TheWarehouse & theWarehouse() const
virtual void printGeneralExecutionInformation() const
Print list of object types executed and in which order.
virtual void pre()
This is called once before all face-looping.
virtual void onFace(const FaceInfo &fi)=0
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
Provides a way for users to bail out of the current solve.
void caughtMooseException(MooseException &e)
Called if a MooseException is caught anywhere during the computation.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:466
virtual void subdomainChanged()
Called every time the current subdomain changes (i.e.
const bool _on_displaced
Whether this loop is operating on the displaced mesh.
virtual void printBlockExecutionInformation() const
Print ordering of objects executed on each block.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
SubdomainID _old_subdomain
The subdomain for the last element.
SubdomainID _old_neighbor_subdomain
The subdomain for the last neighbor.

◆ post()

void ComputeFVFluxThread< RangeType, AttribVectorTags >::post ( )
overridevirtualinherited

This is called once after all face-looping is finished.

Reimplemented from ThreadedFaceLoop< RangeType >.

Definition at line 566 of file ComputeFVFluxThread.h.

567 {
568  // make sure we add any remaining cached residuals/jacobians to add/record
569  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
570  addCached();
571 
574 }
FEProblemBase & _fe_problem
void clearActiveMaterialProperties(const THREAD_ID tid)
Clear the active material properties.
virtual void addCached()=0
call either addCachedJacobian or addCachedResidual or both depending on what derived class of this cl...
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.

◆ postFace()

template<typename RangeType >
void ComputeFVFluxResidualThread< RangeType >::postFace ( const FaceInfo )
overrideprotectedvirtual

This is called once for each face after all face and boundary callbacks have been finished for that face.

Reimplemented from ThreadedFaceLoop< RangeType >.

Definition at line 860 of file ComputeFVFluxThread.h.

861 {
862  _num_cached++;
863  // TODO: do we need both calls - or just the neighbor one? - confirm this
864  this->_subproblem.SubProblem::cacheResidual(_tid);
865  this->_subproblem.SubProblem::cacheResidualNeighbor(_tid);
866 
867  this->_subproblem.SubProblem::addCachedResidual(_tid);
868 }
SubProblem & _subproblem
FEProblemBase or DisplacedProblem depending on _on_displaced.

◆ pre()

void ComputeFVFluxThread< RangeType, AttribVectorTags >::pre ( )
overridevirtualinherited

This is called once before all face-looping.

Reimplemented from ThreadedFaceLoop< RangeType >.

Definition at line 757 of file ComputeFVFluxThread.h.

758 {
759  std::vector<FVFluxBC *> bcs;
761  .query()
762  .template condition<AttribSysNum>(_nl_system_num)
763  .template condition<AttribSystem>("FVFluxBC")
764  .template condition<AttribDisplaced>(_on_displaced)
765  .template condition<AttribThread>(_tid)
766  .template condition<AttributeTagType>(_tags)
767  .queryInto(bcs);
768 
769  std::vector<FVInterfaceKernel *> iks;
771  .query()
772  .template condition<AttribSysNum>(_nl_system_num)
773  .template condition<AttribSystem>("FVInterfaceKernel")
774  .template condition<AttribDisplaced>(_on_displaced)
775  .template condition<AttribThread>(_tid)
776  .template condition<AttributeTagType>(_tags)
777  .queryInto(iks);
778 
779  std::vector<FVFluxKernel *> kernels;
781  .query()
782  .template condition<AttribSysNum>(_nl_system_num)
783  .template condition<AttribSystem>("FVFluxKernel")
784  .template condition<AttribDisplaced>(_on_displaced)
785  .template condition<AttribThread>(_tid)
786  .template condition<AttributeTagType>(_tags)
787  .queryInto(kernels);
788 
789  for (auto * const bc : bcs)
790  setup(*bc);
791  for (auto * const ik : iks)
792  setup(*ik);
793  for (auto * const kernel : kernels)
794  setup(*kernel);
795 
796  // Clear variables
797  _fv_vars.clear();
798  _elem_sub_fv_vars.clear();
799  _neigh_sub_fv_vars.clear();
800 
801  // Clear kernels
802  _fv_flux_kernels.clear();
805 
806  // Clear element face materials
807  _elem_face_mats.clear();
808  _elem_sub_elem_face_mats.clear();
810 
811  // Clear neighbor face materials
812  _neigh_face_mats.clear();
815 }
std::vector< std::shared_ptr< MaterialBase > > _neigh_face_mats
const unsigned int _nl_system_num
std::vector< std::shared_ptr< MaterialBase > > _neigh_sub_neigh_face_mats
std::vector< std::shared_ptr< MaterialBase > > _elem_sub_neigh_face_mats
FEProblemBase & _fe_problem
std::vector< std::shared_ptr< MaterialBase > > _neigh_sub_elem_face_mats
std::set< MooseVariableFieldBase *> _neigh_sub_fv_vars
const std::set< TagID > & _tags
TheWarehouse & theWarehouse() const
std::vector< std::shared_ptr< MaterialBase > > _elem_face_mats
Element face materials.
std::vector< std::shared_ptr< MaterialBase > > _elem_sub_elem_face_mats
std::set< FVFluxKernel *> _fv_flux_kernels
FVFluxKernels.
std::set< MooseVariableFieldBase *> _elem_sub_fv_vars
std::set< MooseVariableFieldBase *> _fv_vars
Variables.
virtual void setup(SetupInterface &obj)=0
call either residualSetup or jacobianSetup depending on what derived class of this class is instantia...
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:466
const bool _on_displaced
Whether this loop is operating on the displaced mesh.

◆ resetExecutionPrinting()

template<typename RangeType>
void ThreadedFaceLoop< RangeType >::resetExecutionPrinting ( )
inlineprotectedinherited

Reset lists of blocks and boundaries for which execution printing has been done.

Definition at line 134 of file ComputeFVFluxThread.h.

135  {
136  _blocks_exec_printed.clear();
137  _boundaries_exec_printed.clear();
138  }
std::set< BoundaryID > _boundaries_exec_printed
Set to keep track of boundaries for which we have printed the execution pattern.
std::set< std::pair< const SubdomainID, const SubdomainID > > _blocks_exec_printed
Set to keep track of blocks for which we have printed the execution pattern.

◆ setup()

template<typename RangeType>
void ComputeFVFluxResidualThread< RangeType >::setup ( SetupInterface obj)
inlineoverrideprotectedvirtual

call either residualSetup or jacobianSetup depending on what derived class of this class is instantiated

Implements ComputeFVFluxThread< RangeType, AttribVectorTags >.

Definition at line 837 of file ComputeFVFluxThread.h.

837 { obj.residualSetup(); }
virtual void residualSetup()
Gets called just before the residual is computed and before this object is asked to do its job...

◆ subdomainChanged()

void ComputeFVFluxThread< RangeType, AttribVectorTags >::subdomainChanged ( )
overridevirtualinherited

Called every time the current subdomain changes (i.e.

the subdomain of this face's elem element is not the same as the subdomain of the last face's elem element).

Reimplemented from ThreadedFaceLoop< RangeType >.

Definition at line 634 of file ComputeFVFluxThread.h.

635 {
637 
638  // Clear variables
639  _fv_vars.clear();
640  _elem_sub_fv_vars.clear();
641 
642  // Clear kernels
643  _fv_flux_kernels.clear();
645 
646  // Clear element face materials
647  _elem_face_mats.clear();
648  _elem_sub_elem_face_mats.clear();
649 
650  // Clear neighbor face materials
651  _neigh_face_mats.clear();
653 
654  // TODO: do this for other relevant objects - like FV BCs, FV source term
655  // kernels, etc. - but we don't need to add them for other types of objects
656  // like FE or DG kernels because those kernels don't run in this loop. Do we
657  // really want to integrate fv source kernels into this loop?
658  std::vector<FVFluxKernel *> kernels;
660  .query()
661  .template condition<AttribSysNum>(_nl_system_num)
662  .template condition<AttribSystem>("FVFluxKernel")
663  .template condition<AttribDisplaced>(_on_displaced)
664  .template condition<AttribSubdomains>(_subdomain)
665  .template condition<AttribThread>(_tid)
666  .template condition<AttributeTagType>(_tags)
667  .queryInto(kernels);
668 
669  _elem_sub_fv_flux_kernels = std::set<FVFluxKernel *>(kernels.begin(), kernels.end());
670 
671  for (auto * k : _elem_sub_fv_flux_kernels)
672  {
673  // TODO: we need a better way to do this - especially when FE objects begin to
674  // couple to FV vars. This code shoud be refactored out into one place
675  // where it is easy for users to say initialize all materials and
676  // variables needed by these objects for me.
677  const auto & deps = k->getMooseVariableDependencies();
678  for (auto var : deps)
679  {
680  mooseAssert(var->isFV(),
681  "We do not currently support coupling of FE variables into FV objects");
682  _elem_sub_fv_vars.insert(var);
683  }
684  }
685 
688 
690 }
std::vector< std::shared_ptr< MaterialBase > > _neigh_face_mats
void getFVMatsAndDependencies(SubdomainID block_id, std::vector< std::shared_ptr< MaterialBase >> &face_materials, std::vector< std::shared_ptr< MaterialBase >> &neighbor_materials, std::set< MooseVariableFieldBase *> &variables, const THREAD_ID tid)
Get the materials and variables potentially needed for FV.
const unsigned int _nl_system_num
std::vector< std::shared_ptr< MaterialBase > > _elem_sub_neigh_face_mats
FEProblemBase & _fe_problem
SubdomainID _subdomain
The subdomain for the current element.
std::vector< T * > & queryInto(std::vector< T *> &results, Args &&... args)
queryInto executes the query and stores the results in the given vector.
Definition: TheWarehouse.h:311
const std::set< TagID > & _tags
TheWarehouse & theWarehouse() const
std::vector< std::shared_ptr< MaterialBase > > _elem_face_mats
Element face materials.
std::vector< std::shared_ptr< MaterialBase > > _elem_sub_elem_face_mats
std::set< FVFluxKernel *> _fv_flux_kernels
FVFluxKernels.
std::set< MooseVariableFieldBase *> _elem_sub_fv_vars
std::set< MooseVariableFieldBase *> _fv_vars
Variables.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:466
virtual void subdomainChanged()
Called every time the current subdomain changes (i.e.
const bool _on_displaced
Whether this loop is operating on the displaced mesh.

Member Data Documentation

◆ _blocks_exec_printed

template<typename RangeType>
std::set<std::pair<const SubdomainID, const SubdomainID> > ThreadedFaceLoop< RangeType >::_blocks_exec_printed
mutableprotectedinherited

Set to keep track of blocks for which we have printed the execution pattern.

Definition at line 165 of file ComputeFVFluxThread.h.

Referenced by ThreadedFaceLoop< RangeType >::resetExecutionPrinting().

◆ _boundaries_exec_printed

template<typename RangeType>
std::set<BoundaryID> ThreadedFaceLoop< RangeType >::_boundaries_exec_printed
mutableprotectedinherited

Set to keep track of boundaries for which we have printed the execution pattern.

Definition at line 168 of file ComputeFVFluxThread.h.

Referenced by ThreadedFaceLoop< RangeType >::resetExecutionPrinting().

◆ _error_message

template<typename RangeType>
std::string ThreadedFaceLoop< RangeType >::_error_message
protectedinherited

Holds caught runtime error messages.

Definition at line 171 of file ComputeFVFluxThread.h.

Referenced by ThreadedFaceLoop< RangeType >::join().

◆ _fe_problem

template<typename RangeType>
FEProblemBase& ThreadedFaceLoop< RangeType >::_fe_problem
protectedinherited

◆ _mesh

template<typename RangeType>
MooseMesh& ThreadedFaceLoop< RangeType >::_mesh
protectedinherited

Definition at line 141 of file ComputeFVFluxThread.h.

◆ _neighbor_subdomain

template<typename RangeType>
SubdomainID ThreadedFaceLoop< RangeType >::_neighbor_subdomain
protectedinherited

The subdomain for the current neighbor.

Definition at line 159 of file ComputeFVFluxThread.h.

Referenced by ThreadedFaceLoop< RangeType >::neighborSubdomainChanged().

◆ _nl_system_num

template<typename RangeType>
const unsigned int ThreadedFaceLoop< RangeType >::_nl_system_num
protectedinherited

Definition at line 144 of file ComputeFVFluxThread.h.

◆ _num_cached

unsigned int ComputeFVFluxThread< RangeType, AttribVectorTags >::_num_cached
protectedinherited

Definition at line 393 of file ComputeFVFluxThread.h.

◆ _old_neighbor_subdomain

template<typename RangeType>
SubdomainID ThreadedFaceLoop< RangeType >::_old_neighbor_subdomain
protectedinherited

The subdomain for the last neighbor.

Definition at line 162 of file ComputeFVFluxThread.h.

◆ _old_subdomain

template<typename RangeType>
SubdomainID ThreadedFaceLoop< RangeType >::_old_subdomain
protectedinherited

The subdomain for the last element.

Definition at line 156 of file ComputeFVFluxThread.h.

◆ _on_displaced

template<typename RangeType>
const bool ThreadedFaceLoop< RangeType >::_on_displaced
protectedinherited

Whether this loop is operating on the displaced mesh.

Definition at line 147 of file ComputeFVFluxThread.h.

◆ _subdomain

template<typename RangeType>
SubdomainID ThreadedFaceLoop< RangeType >::_subdomain
protectedinherited

The subdomain for the current element.

Definition at line 153 of file ComputeFVFluxThread.h.

Referenced by ThreadedFaceLoop< RangeType >::subdomainChanged().

◆ _subproblem

template<typename RangeType>
SubProblem& ThreadedFaceLoop< RangeType >::_subproblem
protectedinherited

◆ _tags

template<typename RangeType>
const std::set<TagID>& ThreadedFaceLoop< RangeType >::_tags
protectedinherited

Definition at line 142 of file ComputeFVFluxThread.h.

◆ _tid

template<typename RangeType>
THREAD_ID ThreadedFaceLoop< RangeType >::_tid
protectedinherited

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