1#ifndef __CS_CDO_SYSTEM_H__
2#define __CS_CDO_SYSTEM_H__
447 switch (solver_class) {
454#if defined(HAVE_HYPRE)
488 if (block_id < 0 || block_id >= sh->
n_blocks)
void() cs_cdo_assembly_func_t(const cs_sdm_t *m, const cs_lnum_t *dof_ids, const cs_range_set_t *rset, cs_cdo_assembly_t *eqa, cs_matrix_assembler_values_t *mav)
Assemble a cellwise matrix into the global matrix Block or no block versions are handled.
Definition: cs_cdo_assembly.h:78
cs_range_set_t * cs_cdo_system_get_range_set(const cs_cdo_system_helper_t *sh, int block_id)
Retrieve the range set structure associated to the given block_id.
Definition: cs_cdo_system.cpp:1562
cs_cdo_system_block_t * cs_cdo_system_add_dblock(cs_cdo_system_helper_t *sh, int block_id, cs_cdo_system_matrix_class_t matclass, cs_flag_t location, cs_lnum_t n_elements, int stride, bool interlaced, bool unrolled)
Add a default block definition at position "block_id" in the helper structure Only metadata are set a...
Definition: cs_cdo_system.cpp:1170
void cs_cdo_system_helper_free(cs_cdo_system_helper_t **p_helper)
Free a cs_cdo_system_helper_t structure.
Definition: cs_cdo_system.cpp:1127
void cs_cdo_system_helper_finalize_assembly(cs_cdo_system_helper_t *sh)
Finalize the assembly after the cellwise building and assembly.
Definition: cs_cdo_system.cpp:1982
void cs_cdo_system_init_sharing(cs_mesh_t *mesh, cs_cdo_connect_t *connect)
Allocate and initialize matrix-related structures according to the type of discretization used for th...
Definition: cs_cdo_system.cpp:1052
cs_cdo_system_block_t * cs_cdo_system_add_ublock(cs_cdo_system_helper_t *sh, int block_id, const cs_adjacency_t *adjacency, cs_flag_t location, cs_lnum_t n_elements, int stride, bool interlaced)
Add an unassembled block definition at position "block_id" in the helper structure Only metadata are ...
Definition: cs_cdo_system.cpp:1404
cs_cdo_system_block_type_t
type of block composing a (block) matrix
Definition: cs_cdo_system.h:91
@ CS_CDO_SYSTEM_BLOCK_EXT
Definition: cs_cdo_system.h:96
@ CS_CDO_SYSTEM_N_BLOCK_TYPES
Definition: cs_cdo_system.h:98
@ CS_CDO_SYSTEM_BLOCK_DEFAULT
Definition: cs_cdo_system.h:93
@ CS_CDO_SYSTEM_BLOCK_UNASS
Definition: cs_cdo_system.h:95
@ CS_CDO_SYSTEM_BLOCK_SPLIT
Definition: cs_cdo_system.h:94
void cs_cdo_system_helper_reset(cs_cdo_system_helper_t *sh)
Free matrix and rhs after the solve step.
Definition: cs_cdo_system.cpp:2043
static cs_cdo_system_matrix_class_t cs_cdo_system_which_matrix_class(cs_param_solver_class_t solver_class)
Get the best available class of matrix knowing the solver class.
Definition: cs_cdo_system.h:445
void cs_cdo_system_allocate_assembly(void)
Initialize shared assembly structures from the existing helper structures.
Definition: cs_cdo_system.cpp:2108
cs_cdo_system_block_t * cs_cdo_system_add_xblock(cs_cdo_system_helper_t *sh, int block_id, cs_lnum_t n_dofs)
Add an external block definition at position "block_id" in the helper structure. Only metadata are se...
Definition: cs_cdo_system.cpp:1492
cs_cdo_system_block_t * cs_cdo_system_add_sblock(cs_cdo_system_helper_t *sh, int block_id, cs_cdo_system_matrix_class_t matclass, cs_flag_t location, cs_lnum_t n_elements, int stride)
Add a split block definition at position "block_id" in the helper structure. Only metadata are set at...
Definition: cs_cdo_system.cpp:1271
cs_cdo_system_helper_t * cs_cdo_system_helper_create(cs_cdo_system_type_t type, int n_col_blocks, const cs_lnum_t *col_block_sizes, int n_blocks)
Create a system_helper structure from its set of metadata. n_col_blocks and n_blocks may differ accor...
Definition: cs_cdo_system.cpp:1076
cs_cdo_system_matrix_class_t
Class of matrices to consider.
Definition: cs_cdo_system.h:119
@ CS_CDO_SYSTEM_MATRIX_HYPRE
Definition: cs_cdo_system.h:124
@ CS_CDO_SYSTEM_N_MATRIX_CLASSES
Definition: cs_cdo_system.h:126
@ CS_CDO_SYSTEM_MATRIX_NONE
Definition: cs_cdo_system.h:121
@ CS_CDO_SYSTEM_MATRIX_CS
Definition: cs_cdo_system.h:122
@ CS_CDO_SYSTEM_MATRIX_PETSC
Definition: cs_cdo_system.h:123
void cs_cdo_system_destroy_all(void)
Free all members associated to system helpers.
Definition: cs_cdo_system.cpp:2170
cs_cdo_system_type_t
Definition: cs_cdo_system.h:62
@ CS_CDO_SYSTEM_COUPLED
Definition: cs_cdo_system.h:65
@ CS_CDO_SYSTEM_SADDLE_POINT
Definition: cs_cdo_system.h:66
@ CS_CDO_SYSTEM_DEFAULT
Definition: cs_cdo_system.h:64
cs_matrix_t * cs_cdo_system_get_matrix(const cs_cdo_system_helper_t *sh, int block_id)
Retrieve the matrix associated to the given block_id. If the type of block is either CS_CDO_SYSTEM_BL...
Definition: cs_cdo_system.cpp:1628
void cs_cdo_system_helper_init_system(cs_cdo_system_helper_t *sh, cs_real_t **p_rhs)
Allocate and initialize the matrix, rhs and the matrix assembler values.
Definition: cs_cdo_system.cpp:1809
void cs_cdo_system_build_block(cs_cdo_system_helper_t *sh, int block_id)
Build the associated structures for the given system_helper structure If a member is already allocate...
Definition: cs_cdo_system.cpp:1721
cs_matrix_t * cs_cdo_system_get_sub_matrix(cs_cdo_system_helper_t *sh, int block_id, int sub_id)
Retrieve the (sub-)matrix associated to a split block with id equal to block_id. sub_id is the id in ...
Definition: cs_cdo_system.cpp:1680
static cs_cdo_system_matrix_class_t cs_cdo_system_get_matrix_class(const cs_cdo_system_helper_t *sh, int block_id)
Get the matrix class related to the given block_id CS_CDO_SYSTEM_MATRIX_NONE is returned if not store...
Definition: cs_cdo_system.h:483
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
unsigned short int cs_flag_t
Definition: cs_defs.h:344
struct _cs_interface_set_t cs_interface_set_t
Definition: cs_interface.h:61
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:106
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:110
struct _cs_matrix_assembler_t cs_matrix_assembler_t
Definition: cs_matrix_assembler.h:61
struct _cs_matrix_assembler_values_t cs_matrix_assembler_values_t
Definition: cs_matrix_assembler.h:65
cs_param_solver_class_t
Class of iterative solvers to consider for solver the linear system.
Definition: cs_param_types.h:643
@ CS_PARAM_SOLVER_CLASS_CS
Definition: cs_param_types.h:645
@ CS_PARAM_SOLVER_CLASS_HYPRE
Definition: cs_param_types.h:646
Definition: cs_mesh_adjacencies.h:68
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_system.h:131
int stride
Definition: cs_cdo_system.h:143
cs_cdo_system_matrix_class_t matrix_class
Definition: cs_cdo_system.h:137
cs_flag_t location
Definition: cs_cdo_system.h:141
bool interlaced
Definition: cs_cdo_system.h:160
cs_lnum_t n_elements
Definition: cs_cdo_system.h:142
bool unrolled
Definition: cs_cdo_system.h:159
Definition: cs_cdo_system.h:335
void * block_pointer
Definition: cs_cdo_system.h:365
cs_cdo_system_block_info_t info
Definition: cs_cdo_system.h:341
cs_cdo_system_block_type_t type
Definition: cs_cdo_system.h:353
int id
Definition: cs_cdo_system.h:357
bool owner
Definition: cs_cdo_system.h:355
Structure associated to the default type of block.
Definition: cs_cdo_system.h:174
cs_matrix_t * matrix
Definition: cs_cdo_system.h:195
cs_cdo_assembly_func_t * slave_assembly_func
Definition: cs_cdo_system.h:198
cs_interface_set_t * interface_set
Definition: cs_cdo_system.h:204
cs_matrix_assembler_values_t * mav
Definition: cs_cdo_system.h:196
cs_range_set_t * range_set
Definition: cs_cdo_system.h:203
cs_matrix_assembler_t * matrix_assembler
Definition: cs_cdo_system.h:205
cs_cdo_assembly_func_t * assembly_func
Definition: cs_cdo_system.h:197
cs_matrix_structure_t * matrix_structure
Definition: cs_cdo_system.h:206
Definition: cs_cdo_system.h:377
cs_real_t ** rhs_array
Definition: cs_cdo_system.h:423
cs_lnum_t * col_block_sizes
Definition: cs_cdo_system.h:417
cs_cdo_system_type_t type
Definition: cs_cdo_system.h:414
cs_cdo_system_block_t ** blocks
Definition: cs_cdo_system.h:426
cs_lnum_t full_rhs_size
Definition: cs_cdo_system.h:420
cs_lnum_t * max_col_block_sizes
Definition: cs_cdo_system.h:418
cs_real_t * _rhs
Definition: cs_cdo_system.h:422
int n_col_blocks
Definition: cs_cdo_system.h:416
cs_real_t * rhs
Definition: cs_cdo_system.h:421
int n_blocks
Definition: cs_cdo_system.h:425
Structure associated to the split type of block.
Definition: cs_cdo_system.h:218
bool matrix_struct_ownership
Definition: cs_cdo_system.h:252
cs_cdo_assembly_func_t * slave_assembly_func
Definition: cs_cdo_system.h:244
cs_interface_set_t * interface_set
Definition: cs_cdo_system.h:250
int n_matrices
Definition: cs_cdo_system.h:240
cs_matrix_assembler_values_t ** mav_array
Definition: cs_cdo_system.h:242
cs_matrix_t ** matrices
Definition: cs_cdo_system.h:241
cs_range_set_t * range_set
Definition: cs_cdo_system.h:249
cs_matrix_assembler_t * matrix_assembler
Definition: cs_cdo_system.h:253
cs_cdo_assembly_func_t * assembly_func
Definition: cs_cdo_system.h:243
cs_matrix_structure_t * matrix_structure
Definition: cs_cdo_system.h:254
Structure associated to the unassembled type of block.
Definition: cs_cdo_system.h:266
bool shared_structures
Definition: cs_cdo_system.h:293
const cs_adjacency_t * adjacency
Definition: cs_cdo_system.h:287
cs_real_t * values
Definition: cs_cdo_system.h:284
cs_real_t * _values
Definition: cs_cdo_system.h:285
cs_interface_set_t * interface_set
Definition: cs_cdo_system.h:295
cs_range_set_t * range_set
Definition: cs_cdo_system.h:294
Structure associated to the extended type of block.
Definition: cs_cdo_system.h:307
cs_matrix_t * matrix
Definition: cs_cdo_system.h:317
cs_interface_set_t * interface_set
Definition: cs_cdo_system.h:323
cs_matrix_assembler_values_t * mav
Definition: cs_cdo_system.h:318
cs_range_set_t * range_set
Definition: cs_cdo_system.h:322
cs_matrix_assembler_t * matrix_assembler
Definition: cs_cdo_system.h:324
cs_matrix_structure_t * matrix_structure
Definition: cs_cdo_system.h:325
Definition: cs_range_set.h:57