The DiscretizationStencilSolverAssembler class defines an assembler for building the stencil solver. More...
Public Types | |
using | assembly_options_type = typename assembly_type::AssemblyOptions |
using | assembly_type = typename solver_kernel_t::Assembler |
using | solver_kernel_type = solver_kernel_t |
using | stencil_type = stencil_t |
Public Member Functions | |
template<typename stencil_container_t , typename... AssemblerKernelArgs> | |
DiscretizationStencilSolverAssembler (const stencil_container_t *stencils, AssemblerKernelArgs &&... assemblerKernelArgs) | |
template<typename stencil_container_t , typename... AssemblerKernelArgs> | |
DiscretizationStencilSolverAssembler (MPI_Comm communicator, bool partitioned, const stencil_container_t *stencils, AssemblerKernelArgs &&... assemblerKernelArgs) | |
int | getBlockSize () const override |
long | getColCount () const override |
long | getColElementCount () const override |
long | getColGlobalCount () const override |
long | getColGlobalElementCount () const override |
long | getColGlobalElementOffset () const override |
long | getColGlobalOffset () const override |
const MPI_Comm & | getCommunicator () const override |
long | getMaxRowNZCount () const override |
assembly_options_type | getOptions () const override |
virtual void | getRowConstant (long rowIndex, bitpit::ConstProxyVector< double > *constant) const |
long | getRowCount () const override |
void | getRowData (long rowIndex, ConstProxyVector< long > *pattern, ConstProxyVector< double > *values) const override |
long | getRowElementCount () const override |
long | getRowGlobalCount () const override |
long | getRowGlobalElementCount () const override |
long | getRowGlobalElementOffset () const override |
long | getRowGlobalOffset () const override |
long | getRowNZCount (long rowIndex) const override |
void | getRowPattern (long rowIndex, ConstProxyVector< long > *pattern) const override |
void | getRowValues (long rowIndex, ConstProxyVector< double > *values) const override |
bool | isPartitioned () const override |
Protected Types | |
using | stencil_value_type = typename stencil_type::value_type |
using | stencil_weight_type = typename stencil_type::weight_type |
Protected Member Functions | |
template<typename... AssemblerKernelArgs> | |
DiscretizationStencilSolverAssembler (AssemblerKernelArgs &&... assemblerKernelArgs) | |
template<typename... AssemblerKernelArgs> | |
DiscretizationStencilSolverAssembler (MPI_Comm communicator, bool partitioned, AssemblerKernelArgs &&... assemblerKernelArgs) | |
template<typename... AssemblerKernelArgs> | |
DiscretizationStencilSolverAssembler (MPI_Comm communicator, bool partitioned, std::unique_ptr< DiscretizationStencilStorageInterface< stencil_t > > &&stencils, AssemblerKernelArgs &&... assemblerKernelArgs) | |
template<typename... AssemblerKernelArgs> | |
DiscretizationStencilSolverAssembler (std::unique_ptr< DiscretizationStencilStorageInterface< stencil_t > > &&stencils, AssemblerKernelArgs &&... assemblerKernelArgs) | |
template<typename W = stencil_weight_type, typename std::enable_if< std::is_fundamental< W >::value >::type * = nullptr> | |
void | getConstant (const stencil_t &stencil, bitpit::ConstProxyVector< double > *constant) const |
template<typename W = stencil_weight_type, typename std::enable_if<!std::is_fundamental< W >::value >::type * = nullptr> | |
void | getConstant (const stencil_t &stencil, bitpit::ConstProxyVector< double > *constant) const |
void | getPattern (const stencil_t &stencil, ConstProxyVector< long > *pattern) const |
virtual const stencil_t & | getRowStencil (long rowIndex) const |
template<typename W = stencil_weight_type, typename std::enable_if< std::is_fundamental< W >::value >::type * = nullptr> | |
void | getValues (const stencil_t &stencil, ConstProxyVector< double > *values) const |
template<typename W = stencil_weight_type, typename std::enable_if<!std::is_fundamental< W >::value >::type * = nullptr> | |
void | getValues (const stencil_t &stencil, ConstProxyVector< double > *values) const |
template<typename W = stencil_weight_type, typename V = stencil_value_type, typename std::enable_if< std::is_fundamental< W >::value >::type * = nullptr> | |
void | setBlockSize () |
template<typename W = stencil_weight_type, typename V = stencil_value_type, std::size_t D = std::tuple_size<W>::value, typename std::enable_if< std::is_same< std::array< V, D >, W >::value >::type * = nullptr> | |
void | setBlockSize () |
template<typename W = stencil_weight_type, typename V = stencil_value_type, typename std::enable_if< std::is_same< std::vector< V >, W >::value >::type * = nullptr> | |
void | setBlockSize () |
void | setBlockSize (int blockSize) |
void | setMatrixSizes () |
void | setMatrixSizes (long nRows, long nCols) |
void | setMaximumRowNZ () |
void | setMaximumRowNZ (long maxRowNZ) |
void | setStencils (std::unique_ptr< DiscretizationStencilStorageInterface< stencil_t > > &&stencils) |
Protected Attributes | |
int | m_blockSize |
long | m_globalColOffset |
long | m_globalRowOffset |
long | m_maxRowNZ |
long | m_nCols |
long | m_nGlobalCols |
long | m_nGlobalRows |
long | m_nRows |
std::unique_ptr< DiscretizationStencilStorageInterface< stencil_t > > | m_stencils |
The DiscretizationStencilSolverAssembler class defines an assembler for building the stencil solver.
Definition at line 103 of file stencil_solver.hpp.
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::assembly_options_type = typename assembly_type::AssemblyOptions |
Definition at line 110 of file stencil_solver.hpp.
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::assembly_type = typename solver_kernel_t::Assembler |
Definition at line 109 of file stencil_solver.hpp.
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::solver_kernel_type = solver_kernel_t |
Definition at line 108 of file stencil_solver.hpp.
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::stencil_type = stencil_t |
Definition at line 106 of file stencil_solver.hpp.
|
protected |
Definition at line 160 of file stencil_solver.hpp.
|
protected |
Definition at line 159 of file stencil_solver.hpp.
bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::DiscretizationStencilSolverAssembler | ( | const stencil_container_t * | stencils, |
AssemblerKernelArgs &&... | assemblerKernelArgs ) |
Constructor.
stencils | are the stencils |
assemblerKernelArgs | are the arguments that will be passed to the constructor of the assembler of the solver kernel |
Definition at line 220 of file stencil_solver.tpp.
bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::DiscretizationStencilSolverAssembler | ( | MPI_Comm | communicator, |
bool | partitioned, | ||
const stencil_container_t * | stencils, | ||
AssemblerKernelArgs &&... | assemblerKernelArgs ) |
Constructor.
communicator | is the MPI communicator |
partitioned | controls if the matrix is partitioned |
stencils | are the stencils |
assemblerKernelArgs | are the arguments that will be passed to the constructor of the assembler of the solver kernel |
Definition at line 237 of file stencil_solver.tpp.
|
protected |
Constructor.
stencils | are the stencils |
assemblerKernelArgs | are the arguments that will be passed to the constructor of the assembler of the solver kernel |
Definition at line 273 of file stencil_solver.tpp.
|
protected |
Constructor.
assemblerKernelArgs | are the arguments that will be passed to the constructor of the assembler of the solver kernel |
Definition at line 324 of file stencil_solver.tpp.
|
protected |
Constructor.
communicator | is the MPI communicator |
partitioned | controls if the matrix is partitioned |
stencils | are the stencils |
assemblerKernelArgs | are the arguments that will be passed to the constructor of the assembler of the solver kernel |
Definition at line 290 of file stencil_solver.tpp.
|
protected |
Constructor.
communicator | is the MPI communicator |
partitioned | controls if the matrix is partitioned |
assemblerKernelArgs | are the arguments that will be passed to the constructor of the assembler of the solver kernel |
Definition at line 339 of file stencil_solver.tpp.
|
override |
Get the stencil block size.
Definition at line 592 of file stencil_solver.tpp.
|
override |
Get the number of (block) columns handled by the assembler.
If the matrix is a block matrix (i.e., the block size is greater than one), this function will return the number of block columns, where a block column is defined as a group of blockSize matrix columns.
Definition at line 622 of file stencil_solver.tpp.
|
override |
Get the number of elements in the columns handled by the assembler.
This function will return the effective number of columns of the matrix that will be assembled.
Definition at line 652 of file stencil_solver.tpp.
|
override |
Get number of global (block) columns handled by the assembler.
If the matrix is a block matrix (i.e., the block size is greater than one), this function will return the global number of block columns, where a block column is defined as a group of blockSize matrix columns.
Definition at line 685 of file stencil_solver.tpp.
|
override |
Get the global number of columns handled by the assembler.
This function will return the effective global number of columns of the system matrix.
Definition at line 715 of file stencil_solver.tpp.
|
override |
Get global offset for the elements of the column.
This function will return the offset expressed in effective columns of the system matrix.
Definition at line 769 of file stencil_solver.tpp.
|
override |
Get global (block) column offset.
Definition at line 739 of file stencil_solver.tpp.
|
override |
Gets the MPI communicator associated to the matrix.
Definition at line 378 of file stencil_solver.tpp.
|
protected |
Get the constant associated with the specified stencil.
stencil | is the stencil |
constant | is the constant associated with the specified (block) row. If the block size is greater than one, values will be stored in a logically one-dimensional array |
Definition at line 960 of file stencil_solver.tpp.
|
override |
Get the maximum number of non-zero elements per row.
Definition at line 798 of file stencil_solver.tpp.
|
override |
Get the assembly options.
Definition at line 390 of file stencil_solver.tpp.
|
protected |
Get the pattern of the specified stencil.
stencil | is the stencil |
pattern | on output will contain the pattern of the specified stencil |
Definition at line 831 of file stencil_solver.tpp.
|
virtual |
Get the constant associated with the specified row.
rowIndex | is the index of the row in the assembler |
constant | is the constant associated with the specified (block) row. If the block size is greater than one, values will be stored in a logically one-dimensional array |
Definition at line 941 of file stencil_solver.tpp.
|
override |
Get the number of (block) rows handled by the assembler.
If the matrix is a block matrix (i.e., the block size is greater than one), this function will return the number of block rows, where a block row is defined as a group of blockSize matrix rows.
Definition at line 607 of file stencil_solver.tpp.
|
override |
Get the data of the specified row.
rowIndex | is the index of the row in the assembler |
pattern | on output will contain the values of the specified row |
values | on output will contain the values of the specified (block) row. If the block size is greater than one, values will be stored in a logically two-dimensional array that uses a col-major order |
Definition at line 920 of file stencil_solver.tpp.
|
override |
Get the number of elements in the rows handled by the assembler.
This function will return the effective number of rows of the matrix that will be assembled.
Definition at line 636 of file stencil_solver.tpp.
|
override |
Get number of global (block) rows handled by the assembler.
If the matrix is a block matrix (i.e., the block size is greater than one), this function will return the global number of block rows, where a block row is defined as a group of blockSize matrix rows.
Definition at line 670 of file stencil_solver.tpp.
|
override |
Get the number of global elements in the rows handled by the assembler.
This function will return the effective global number of rows of the system matrix.
Definition at line 699 of file stencil_solver.tpp.
|
override |
Get global offset for the elements of the row.
This function will return the offset expressed in effective rows of the system matrix.
Definition at line 753 of file stencil_solver.tpp.
|
override |
Get global (block) row offset.
Definition at line 728 of file stencil_solver.tpp.
|
override |
Get the number of non-zero elements in the specified row.
rowIndex | is the index of the row in the assembler |
Definition at line 784 of file stencil_solver.tpp.
|
override |
Get the pattern of the specified row.
If the assembler is a block assembler (i.e., the block size is greater than one), this function will return the global ids of the block columns of the row, where a block column is defined as a group of blockSize assembler columns.
rowIndex | is the index of the row in the assembler |
pattern | on output will contain the pattern of the specified row |
Definition at line 815 of file stencil_solver.tpp.
|
protectedvirtual |
Get the stencil associated with the specified row.
rowIndex | is the index of the row in the assembler |
Definition at line 1002 of file stencil_solver.tpp.
|
override |
Get the values of the specified (block) row.
If the assembler is a block assembler (i.e., the block size is greater than one), this function will return the values of all the elements of a block row, where a block column is defined as a group of blockSize assembler columns. The values are returned as a row-oriented logically two-dimensional array of values.
values | on output will contain the values of the specified (block) row. If the block size is greater than one, values will be stored in a logically two-dimensional array that uses a col-major order |
Definition at line 853 of file stencil_solver.tpp.
|
protected |
Get the values of the specified stencil.
stencil | is the stencil |
values | on output will contain the values of the specified (block) row. If the block size is greater than one, values will be stored in a logically two-dimensional array that uses a col-major order |
Definition at line 872 of file stencil_solver.tpp.
|
override |
Checks if the matrix is partitioned.
Definition at line 367 of file stencil_solver.tpp.
|
protected |
Set block size.
Initialize block size.
The block size is set equal to the square root of the weight size; if the square root of the weight type is not an integer number, an exception is throw.
Block size is evaluated from the first weight. If the size of the other weights don't match the size of the first one, an exception is thrown only when bitpit is compiled in debug mode, otherwise the error is silently ignored.
Definition at line 404 of file stencil_solver.tpp.
|
protected |
Set block size.
Definition at line 414 of file stencil_solver.tpp.
|
protected |
Set block size.
blockSize | is the block size |
Definition at line 491 of file stencil_solver.tpp.
|
protected |
Set matrix sizes.
Definition at line 511 of file stencil_solver.tpp.
|
protected |
Set matrix sizes.
nRows | are the rows of the matrix |
nCols | are the columns of the matrix |
Definition at line 523 of file stencil_solver.tpp.
|
protected |
Set the maximum number of non-zero element on a single row.
Definition at line 565 of file stencil_solver.tpp.
|
protected |
Set the maximum number of non-zero element on a single row.
maxRowNZ | is the maximum number of non-zero element on a single row |
Definition at line 581 of file stencil_solver.tpp.
|
protected |
Set the stencils.
stencils | are the stencils |
Definition at line 502 of file stencil_solver.tpp.
|
protected |
Definition at line 175 of file stencil_solver.hpp.
|
protected |
Definition at line 170 of file stencil_solver.hpp.
|
protected |
Definition at line 169 of file stencil_solver.hpp.
|
protected |
Definition at line 177 of file stencil_solver.hpp.
|
protected |
Definition at line 163 of file stencil_solver.hpp.
|
protected |
Definition at line 167 of file stencil_solver.hpp.
|
protected |
Definition at line 166 of file stencil_solver.hpp.
|
protected |
Definition at line 162 of file stencil_solver.hpp.
|
protected |
Definition at line 173 of file stencil_solver.hpp.