Top-level orchestrator. More...
#include <cl_FEM_Kernel.hpp>
Public Member Functions | |
| Kernel (KernelParameters *aKernelParameters) | |
| Collective: all ranks construct the kernel. | |
| ~Kernel () | |
| Kernel (const Kernel &)=delete | |
| Kernel (Kernel &&)=delete | |
| Kernel & | operator= (const Kernel &)=delete |
| Kernel & | operator= (Kernel &&)=delete |
| const KernelParameters * | params () |
| The parameters are borrowed unless claim_parameter_ownership() was called. | |
| DofManager * | dofmgr (const uint aIndex=0) |
| The dof manager at aIndex; owned by the kernel, never deleted by the caller. | |
| Material * | material (const string &aLabel) |
| returns the material object registered under aLabel ( add_material ). | |
| void | add_material (const string aLabel, Material *aMaterial) |
| manually add a material to the kernel. | |
| void | add_boundary_condition (PhysicalBoundaryCondition *aBC) |
| manually add the BCs to the kernel. | |
| Cell< PhysicalBoundaryCondition * > & | boundary_conditions () |
| expose the boundary condition container | |
| PhysicalBoundaryCondition * | boundary_condition (id_t aID) |
| expose a boundary condition for a specific sideset ID | |
| void | compute_boundary_conditions (real aTime) |
| Computes the boundary conditions and updates the dofs at aTime. | |
| 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 deletes one. | |
| const Cell< const mesh::CommTable * > & | comm_tables () const |
| const proc_t & | number_of_procs () const |
| const uint & | field_offset () const |
| returns the number of fields that existed before Kernel was created | |
| Mesh * | mesh () |
| The mesh on the master, the submesh on every other rank. | |
| 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. | |
| void | add_equation (IWG *aEquation) |
| special function to add an equation that has already been created. | |
| DofManager * | create_field (IWG *aEquation) |
| Collective; it performs a barrier. | |
| bool | is_master () const |
| void | claim_parameter_ownership (const bool aFlag=true) |
| if this flag is set, the kernel will destroy the parameters | |
| 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. | |
| void | set_controller (Controller *aController) |
| Borrowed and never deleted: the controller must outlive the kernel. | |
| Controller * | controller () |
| bool | has_controller () const |
| true once set_controller() has attached a Controller; callers that may legitimately run without one ask this before calling controller() | |
| void | compute_element_volumes () |
| Collective: every rank must enter it. | |
| uint | number_of_dof_managers () const |
Top-level orchestrator.
Owns the equations, dof managers, materials and boundary conditions it creates or is handed. The mesh of the parameters is borrowed unless the factory that created it called claim_mesh_ownership(), as MaxwellFactory does; on the worker ranks the kernel owns the submesh it receives when it distributes the mesh itself, and borrows it from the parent kernel when chained onto one.
| belfem::fem::Kernel::Kernel | ( | KernelParameters * | aKernelParameters | ) |
Collective: all ranks construct the kernel.
It partitions the mesh on the master, distributes the submeshes, and barriers twice.
| belfem::fem::Kernel::~Kernel | ( | ) |
|
delete |
|
delete |
| void belfem::fem::Kernel::add_boundary_condition | ( | PhysicalBoundaryCondition * | aBC | ) |
manually add the BCs to the kernel.
The BC is now owned and destroyed by the kernel
| void belfem::fem::Kernel::add_equation | ( | IWG * | aEquation | ) |
special function to add an equation that has already been created.
The equation is now owned and destroyed by the kernel
manually add a material to the kernel.
The material is now owned and destroyed by the kernel
|
inline |
expose a boundary condition for a specific sideset ID
|
inline |
expose the boundary condition container
Owned by the kernel; the container is a view.
| void belfem::fem::Kernel::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.
Only the factory that created that mesh calls this; a kernel chained onto a parent borrows the parent's mesh and must not.
| void belfem::fem::Kernel::claim_parameter_ownership | ( | const bool | aFlag = true | ) |
if this flag is set, the kernel will destroy the parameters
|
inline |
Borrowed: the kernel deletes the comm tables only when it built them itself, so the caller never deletes one.
|
inline |
| void belfem::fem::Kernel::compute_boundary_conditions | ( | real | aTime | ) |
Computes the boundary conditions and updates the dofs at aTime.
aTime is the absolute simulation time [s].
| void belfem::fem::Kernel::compute_element_volumes | ( | ) |
Collective: every rank must enter it.
Measures every owned element into the hidden mesh field "_Volumes", exchanges the thin-shell areas, and aborts on the master if any volume is negative.
| Controller * belfem::fem::Kernel::controller | ( | ) |
| IWG * belfem::fem::Kernel::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.
| DofManager * belfem::fem::Kernel::create_field | ( | IWG * | aEquation | ) |
Collective; it performs a barrier.
The kernel owns and destroys the returned dof manager. aEquation is linked, not adopted: pass it to the kernel through create_equation() or add_equation(), or it leaks.
| DofManager * belfem::fem::Kernel::dofmgr | ( | const uint | aIndex = 0 | ) |
The dof manager at aIndex; owned by the kernel, never deleted by the caller.
|
inline |
returns the number of fields that existed before Kernel was created
|
inline |
true once set_controller() has attached a Controller; callers that may legitimately run without one ask this before calling controller()
|
inline |
returns the material object registered under aLabel ( add_material ).
Hard error if no such material exists. Called from Group::set_material( label )
|
inline |
The mesh on the master, the submesh on every other rank.
Never deleted by the caller: the master's mesh belongs to this kernel once its factory handed it over ( claim_mesh_ownership ) and to its creator otherwise, a worker's submesh to this kernel or to the parent kernel it is chained onto ( see the class brief ).
|
inline |
|
inline |
| const KernelParameters * belfem::fem::Kernel::params | ( | ) |
The parameters are borrowed unless claim_parameter_ownership() was called.
| void belfem::fem::Kernel::set_controller | ( | Controller * | aController | ) |
Borrowed and never deleted: the controller must outlive the kernel.