www.mooseframework.org
ComputeInitialConditionThread.C
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 
16 #include "FEProblem.h"
17 #include "DisplacedProblem.h"
18 #include "Assembly.h"
19 #include "InitialCondition.h"
20 
22  : _fe_problem(fe_problem)
23 {
24 }
25 
27  Threads::split /*split*/)
29 {
30 }
31 
32 void
33 ComputeInitialConditionThread::operator()(const ConstElemRange & range)
34 {
35  ParallelUniqueId puid;
36  _tid = puid.id;
37 
39 
40  // Iterate over all the elements in the range
41  for (const auto & elem : range)
42  {
43  SubdomainID subdomain = elem->subdomain_id();
45  _fe_problem.prepare(elem, _tid);
46 
47  if (warehouse.hasActiveBlockObjects(subdomain, _tid))
48  {
49  const auto & ics = warehouse.getActiveBlockObjects(subdomain, _tid);
50  for (const auto & ic : ics)
51  ic->compute();
52  }
53  }
54 }
55 
56 void
58 {
59 }
virtual void prepare(const Elem *elem, THREAD_ID tid) override
subdomain_id_type SubdomainID
Definition: MooseTypes.h:77
Warehouse for storing initial conditions.
static PetscErrorCode Vec x
ComputeInitialConditionThread(FEProblemBase &fe_problem)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
void operator()(const ConstElemRange &range)
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
virtual void setCurrentSubdomainID(const Elem *elem, THREAD_ID tid) override
bool hasActiveBlockObjects(THREAD_ID tid=0) const
void join(const ComputeInitialConditionThread &)