12#ifndef BELFEM_CL_FEM_KERNEL_HPP
13#define BELFEM_CL_FEM_KERNEL_HPP
71 const uint mFieldOffset ;
74 Mesh * mSubMesh =
nullptr;
80 bool mOwnParameters = false ;
96 bool mOwnCommTables = false ;
97 bool mOwnMesh = false ;
98 bool mOwnSubmesh = false ;
372 inline const mesh::CommTable *
375 BELFEM_ASSERT( mCommRank == 0,
"Only master may call the comm table." );
376 return mCommTables( aProc );
396 return mFieldOffset ;
404 return mBoundaryConditions ;
414 for (
id_t tID : tBC->domains())
422 BELFEM_ERROR(
false,
"Sideset is not associated to a boundary contition") ;
431 return mCommRank == 0 ? mMesh : mSubMesh ;
439 return mDofManagers.size();
447 return mCommRank == 0 ;
455 return mController != nullptr ;
467 return this->
mesh()->node( aID );
471 return this->
mesh()->edge( aID );
475 return this->
mesh()->face( aID );
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
A bounds-checked wrapper around std::vector.
Definition cl_Cell.hpp:45
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Base class for all materials in BELFEM.
Definition cl_Material.hpp:270
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
mesh::Facet * facet(const id_t aID)
Definition cl_Mesh.hpp:1444
mesh::Element * element(const id_t aID)
Definition cl_Mesh.hpp:1368
Nonlinear iteration controller: relaxation, timestep adaptation and convergence policy.
Definition cl_FEM_Controller.hpp:38
Main workhorse: DOF management, assembly coordination and the solver interface.
Definition cl_FEM_DofManager.hpp:52
Prototype for Integrator of Weak Form Governing Equation.
Definition cl_IWG.hpp:81
Creates IWG instances by equation type.
Definition cl_IwgFactory.hpp:30
Cell< PhysicalBoundaryCondition * > & boundary_conditions()
expose the boundary condition container
Definition cl_FEM_Kernel.hpp:402
Kernel(KernelParameters *aKernelParameters)
Collective: all ranks construct the kernel.
Definition cl_FEM_Kernel.cpp:42
const Cell< const mesh::CommTable * > & comm_tables() const
Definition cl_FEM_Kernel.hpp:380
const KernelParameters * params()
The parameters are borrowed unless claim_parameter_ownership() was called.
Definition cl_FEM_Kernel.cpp:631
PhysicalBoundaryCondition * boundary_condition(id_t aID)
expose a boundary condition for a specific sideset ID
Definition cl_FEM_Kernel.hpp:410
bool is_master() const
Definition cl_FEM_Kernel.hpp:445
Kernel & operator=(const Kernel &)=delete
Material * material(const string &aLabel)
returns the material object registered under aLabel ( add_material ).
Definition cl_FEM_Kernel.cpp:736
Controller * controller()
Definition cl_FEM_Kernel.cpp:1178
void compute_element_volumes()
Collective: every rank must enter it.
Definition cl_FEM_Kernel.cpp:853
bool has_controller() const
true once set_controller() has attached a Controller; callers that may legitimately run without one a...
Definition cl_FEM_Kernel.hpp:453
IWG * create_equation(const IwgType aEquationType, const ModelDimensionality aModelDimensionality=ModelDimensionality::UNDEFINED, const Vector< id_t > aBlocks={}, const Vector< id_t > aSideSets={})
The kernel owns and destroys the returned equation; the caller only borrows it.
Definition cl_FEM_Kernel.cpp:532
void claim_parameter_ownership(const bool aFlag=true)
if this flag is set, the kernel will destroy the parameters
Definition cl_FEM_Kernel.cpp:780
void set_controller(Controller *aController)
Borrowed and never deleted: the controller must outlive the kernel.
Definition cl_FEM_Kernel.cpp:1170
DofManager * create_field(IWG *aEquation)
Collective; it performs a barrier.
Definition cl_FEM_Kernel.cpp:590
uint number_of_dof_managers() const
Definition cl_FEM_Kernel.hpp:437
DofManager * dofmgr(const uint aIndex=0)
The dof manager at aIndex; owned by the kernel, never deleted by the caller.
Definition cl_FEM_Kernel.cpp:728
Kernel(const Kernel &)=delete
void add_material(const string aLabel, Material *aMaterial)
manually add a material to the kernel.
Definition cl_FEM_Kernel.cpp:748
void compute_boundary_conditions(real aTime)
Computes the boundary conditions and updates the dofs at aTime.
Definition cl_FEM_Kernel.cpp:769
Kernel & operator=(Kernel &&)=delete
const uint & field_offset() const
returns the number of fields that existed before Kernel was created
Definition cl_FEM_Kernel.hpp:394
Mesh * mesh()
The mesh on the master, the submesh on every other rank.
Definition cl_FEM_Kernel.hpp:429
void add_boundary_condition(PhysicalBoundaryCondition *aBC)
manually add the BCs to the kernel.
Definition cl_FEM_Kernel.cpp:761
const proc_t & number_of_procs() const
Definition cl_FEM_Kernel.hpp:386
const mesh::CommTable * comm_table(const uint aProc) const
Borrowed: the kernel deletes the comm tables only when it built them itself, so the caller never dele...
Definition cl_FEM_Kernel.hpp:373
void add_equation(IWG *aEquation)
special function to add an equation that has already been created.
Definition cl_FEM_Kernel.cpp:582
void claim_mesh_ownership(const bool aFlag=true)
Hands the mesh the parameters point at over to this kernel, which then deletes it in its destructor.
Definition cl_FEM_Kernel.cpp:788
Definition cl_FEM_KernelParameters.hpp:29
Definition cl_FEM_PhysicalBoundaryCondition.hpp:37
Definition cl_Mesh_Basis.hpp:33
Definition cl_CommTable.hpp:25
Definition cl_IFB_LINE3.hpp:21
USER GUIDES:
Definition cl_Capacitor.cpp:16
IwgType
Definition en_IWGs.hpp:64
unsigned int uint
Definition typedefs.hpp:30
unsigned int id_t
Definition typedefs.hpp:41
ModelDimensionality
Definition en_IWGs.hpp:20
@ UNDEFINED
Definition en_IWGs.hpp:25
int proc_t
Definition commtypes.hpp:29
EntityType
Definition Mesh_Enums.hpp:116
@ NODE
Definition Mesh_Enums.hpp:117
@ FACE
Definition Mesh_Enums.hpp:119
@ EDGE
Definition Mesh_Enums.hpp:118
@ FACET
Definition Mesh_Enums.hpp:121
@ ELEMENT
Definition Mesh_Enums.hpp:122
double real
Definition typedefs.hpp:36