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 |
Detailed Description
class bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >
The DiscretizationStencilSolverAssembler class defines an assembler for building the stencil solver.
Definition at line 103 of file stencil_solver.hpp.
Member Typedef Documentation
◆ assembly_options_type
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::assembly_options_type = typename assembly_type::AssemblyOptions |
Definition at line 110 of file stencil_solver.hpp.
◆ assembly_type
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::assembly_type = typename solver_kernel_t::Assembler |
Definition at line 109 of file stencil_solver.hpp.
◆ solver_kernel_type
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::solver_kernel_type = solver_kernel_t |
Definition at line 108 of file stencil_solver.hpp.
◆ stencil_type
using bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::stencil_type = stencil_t |
Definition at line 106 of file stencil_solver.hpp.
◆ stencil_value_type
|
protected |
Definition at line 160 of file stencil_solver.hpp.
◆ stencil_weight_type
|
protected |
Definition at line 159 of file stencil_solver.hpp.
Constructor & Destructor Documentation
◆ DiscretizationStencilSolverAssembler() [1/6]
bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::DiscretizationStencilSolverAssembler | ( | const stencil_container_t * | stencils, |
AssemblerKernelArgs &&... | assemblerKernelArgs ) |
Constructor.
- Parameters
-
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 222 of file stencil_solver.tpp.
◆ DiscretizationStencilSolverAssembler() [2/6]
bitpit::DiscretizationStencilSolverAssembler< stencil_t, solver_kernel_t >::DiscretizationStencilSolverAssembler | ( | MPI_Comm | communicator, |
bool | partitioned, | ||
const stencil_container_t * | stencils, | ||
AssemblerKernelArgs &&... | assemblerKernelArgs ) |
Constructor.
- Parameters
-
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 239 of file stencil_solver.tpp.
◆ DiscretizationStencilSolverAssembler() [3/6]
|
protected |
Constructor.
- Parameters
-
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 275 of file stencil_solver.tpp.
◆ DiscretizationStencilSolverAssembler() [4/6]
|
protected |
Constructor.
- Parameters
-
assemblerKernelArgs are the arguments that will be passed to the constructor of the assembler of the solver kernel
Definition at line 326 of file stencil_solver.tpp.
◆ DiscretizationStencilSolverAssembler() [5/6]
|
protected |
Constructor.
- Parameters
-
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 292 of file stencil_solver.tpp.
◆ DiscretizationStencilSolverAssembler() [6/6]
|
protected |
Constructor.
- Parameters
-
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 341 of file stencil_solver.tpp.
Member Function Documentation
◆ getBlockSize()
|
overridevirtual |
Get the stencil block size.
- Returns
- The stencil block size.
Implements bitpit::SystemMatrixAssembler.
Definition at line 583 of file stencil_solver.tpp.
◆ getColCount()
|
overridevirtual |
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.
- Returns
- The number of (block) columns handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 613 of file stencil_solver.tpp.
◆ getColElementCount()
|
overridevirtual |
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.
- Returns
- The number of columns handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 643 of file stencil_solver.tpp.
◆ getColGlobalCount()
|
overridevirtual |
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.
- Returns
- The number of global (block) columns handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 676 of file stencil_solver.tpp.
◆ getColGlobalElementCount()
|
overridevirtual |
Get the global number of columns handled by the assembler.
This function will return the effective global number of columns of the system matrix.
- Returns
- The global number of columns handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 706 of file stencil_solver.tpp.
◆ getColGlobalElementOffset()
|
overridevirtual |
Get global offset for the elements of the column.
This function will return the offset expressed in effective columns of the system matrix.
- Returns
- The global offset for the elements of the column.
Implements bitpit::SystemMatrixAssembler.
Definition at line 760 of file stencil_solver.tpp.
◆ getColGlobalOffset()
|
overridevirtual |
Get global (block) column offset.
- Returns
- The global (block) column offset.
Implements bitpit::SystemMatrixAssembler.
Definition at line 730 of file stencil_solver.tpp.
◆ getCommunicator()
|
overridevirtual |
Gets the MPI communicator associated to the matrix.
- Returns
- The MPI communicator associated to the matrix.
Implements bitpit::SystemMatrixAssembler.
Definition at line 380 of file stencil_solver.tpp.
◆ getConstant()
|
protected |
Get the constant associated with the specified stencil.
- Parameters
-
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 951 of file stencil_solver.tpp.
◆ getMaxRowNZCount()
|
overridevirtual |
Get the maximum number of non-zero elements per row.
- Returns
- The maximum number of non-zero elements per row.
Implements bitpit::SystemMatrixAssembler.
Definition at line 789 of file stencil_solver.tpp.
◆ getOptions()
|
overridevirtual |
Get the assembly options.
- Returns
- The assembly options that will be used.
Implements bitpit::SystemMatrixAssembler.
Definition at line 392 of file stencil_solver.tpp.
◆ getPattern()
|
protected |
Get the pattern of the specified stencil.
- Parameters
-
stencil is the stencil pattern on output will contain the pattern of the specified stencil
Definition at line 822 of file stencil_solver.tpp.
◆ getRowConstant()
|
virtual |
Get the constant associated with the specified row.
- Parameters
-
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 932 of file stencil_solver.tpp.
◆ getRowCount()
|
overridevirtual |
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.
- Returns
- The number of (block) rows handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 598 of file stencil_solver.tpp.
◆ getRowData()
|
overridevirtual |
Get the data of the specified row.
- Parameters
-
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
Implements bitpit::SystemMatrixAssembler.
Definition at line 911 of file stencil_solver.tpp.
◆ getRowElementCount()
|
overridevirtual |
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.
- Returns
- The number of rows handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 627 of file stencil_solver.tpp.
◆ getRowGlobalCount()
|
overridevirtual |
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.
- Returns
- The number of global rows handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 661 of file stencil_solver.tpp.
◆ getRowGlobalElementCount()
|
overridevirtual |
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.
- Returns
- The number of global elements in the rows handled by the assembler.
Implements bitpit::SystemMatrixAssembler.
Definition at line 690 of file stencil_solver.tpp.
◆ getRowGlobalElementOffset()
|
overridevirtual |
Get global offset for the elements of the row.
This function will return the offset expressed in effective rows of the system matrix.
- Returns
- The global offset for the elements of the row.
Implements bitpit::SystemMatrixAssembler.
Definition at line 744 of file stencil_solver.tpp.
◆ getRowGlobalOffset()
|
overridevirtual |
Get global (block) row offset.
- Returns
- The global (block) row offset.
Implements bitpit::SystemMatrixAssembler.
Definition at line 719 of file stencil_solver.tpp.
◆ getRowNZCount()
|
overridevirtual |
Get the number of non-zero elements in the specified row.
- Parameters
-
rowIndex is the index of the row in the assembler
- Returns
- The number of non-zero elements in the specified row.
Implements bitpit::SystemMatrixAssembler.
Definition at line 775 of file stencil_solver.tpp.
◆ getRowPattern()
|
overridevirtual |
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.
- Parameters
-
rowIndex is the index of the row in the assembler pattern on output will contain the pattern of the specified row
Implements bitpit::SystemMatrixAssembler.
Definition at line 806 of file stencil_solver.tpp.
◆ getRowStencil()
|
protectedvirtual |
Get the stencil associated with the specified row.
- Parameters
-
rowIndex is the index of the row in the assembler
- Returns
- The stencil associated with the specified row.
Definition at line 993 of file stencil_solver.tpp.
◆ getRowValues()
|
overridevirtual |
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.
- Parameters
-
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
Implements bitpit::SystemMatrixAssembler.
Definition at line 844 of file stencil_solver.tpp.
◆ getValues()
|
protected |
Get the values of the specified stencil.
- Parameters
-
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 863 of file stencil_solver.tpp.
◆ isPartitioned()
|
overridevirtual |
Checks if the matrix is partitioned.
- Returns
- Returns true if the patch is partitioned, false otherwise.
Implements bitpit::SystemMatrixAssembler.
Definition at line 369 of file stencil_solver.tpp.
◆ setBlockSize() [1/3]
|
protected |
Set block size.
Initialize block size.
The block size is set equal to the square root of the weight/constant size; if the square root of the weight type is not an integer number, an exception is throw.
Block size is evaluated from the constant of the first stencil. If the size of the other weights don't match the size of the evaluated size, an exception is thrown only when bitpit is compiled in debug mode, otherwise the error is silently ignored.
Definition at line 406 of file stencil_solver.tpp.
◆ setBlockSize() [2/3]
|
protected |
Set block size.
Definition at line 416 of file stencil_solver.tpp.
◆ setBlockSize() [3/3]
|
protected |
Set block size.
- Parameters
-
blockSize is the block size
Definition at line 482 of file stencil_solver.tpp.
◆ setMatrixSizes() [1/2]
|
protected |
Set matrix sizes.
Definition at line 502 of file stencil_solver.tpp.
◆ setMatrixSizes() [2/2]
|
protected |
Set matrix sizes.
- Parameters
-
nRows are the rows of the matrix nCols are the columns of the matrix
Definition at line 514 of file stencil_solver.tpp.
◆ setMaximumRowNZ() [1/2]
|
protected |
Set the maximum number of non-zero element on a single row.
Definition at line 556 of file stencil_solver.tpp.
◆ setMaximumRowNZ() [2/2]
|
protected |
Set the maximum number of non-zero element on a single row.
- Parameters
-
maxRowNZ is the maximum number of non-zero element on a single row
Definition at line 572 of file stencil_solver.tpp.
◆ setStencils()
|
protected |
Set the stencils.
- Parameters
-
stencils are the stencils
Definition at line 493 of file stencil_solver.tpp.
Member Data Documentation
◆ m_blockSize
|
protected |
Definition at line 175 of file stencil_solver.hpp.
◆ m_globalColOffset
|
protected |
Definition at line 170 of file stencil_solver.hpp.
◆ m_globalRowOffset
|
protected |
Definition at line 169 of file stencil_solver.hpp.
◆ m_maxRowNZ
|
protected |
Definition at line 177 of file stencil_solver.hpp.
◆ m_nCols
|
protected |
Definition at line 163 of file stencil_solver.hpp.
◆ m_nGlobalCols
|
protected |
Definition at line 167 of file stencil_solver.hpp.
◆ m_nGlobalRows
|
protected |
Definition at line 166 of file stencil_solver.hpp.
◆ m_nRows
|
protected |
Definition at line 162 of file stencil_solver.hpp.
◆ m_stencils
|
protected |
Definition at line 173 of file stencil_solver.hpp.
The documentation for this class was generated from the following files:
- src/discretization/stencil_solver.hpp
- src/discretization/stencil_solver.tpp
