Loading...
Searching...
No Matches
terra::linalg::solvers::TwoGridGCA< ScalarT, Operator > Class Template Reference

: Galerkin coarse approximation (GCA). TwoGridGCA takes a coarser and a finer operator. Each thread assembles a coarse-grid gca matrix in the coarser operator on a single hex. To do this, it loops the finer hexes of the coarse hex and its respective wedges. It computes the interpolation matrix P mapping from coarse wedge to the current fine wedge, computes the triple-product P^TAP with the fine-operator local matrix A and adds the resulting gca matrix up for all fine wedges comprising the coarse wedge. Finally, it stores the result in the wedge-wise matrix storage of the coarse operator. More...

#include <gca.hpp>

Public Types

using SrcVectorType = linalg::VectorQ1Scalar< double >
 
using DstVectorType = linalg::VectorQ1Scalar< double >
 
using ScalarType = ScalarT
 

Public Member Functions

 TwoGridGCA (Operator fine_op, Operator coarse_op, int level_range, grid::Grid4DDataScalar< ScalarType > GCAElements, bool treat_boundary=true, InterpolationMode interpolation_mode=InterpolationMode::Constant)
 GCA Ctor Assembles Galerkin coarse-grid operators in the coarse-op passed.
 
void wedge_vertex_indices (dense::Vec< int, 4 > hex_idx, int wedge, dense::Vec< int, 4 >(&wedge_local_vertex_indices)[6]) const
 Computes indices of vertices associated to a wedge in a hex cell.
 
void operator() (const int local_subdomain_id, const int x_coarse_idx, const int y_coarse_idx, const int r_coarse_idx) const
 

Detailed Description

template<typename ScalarT, terra::linalg::GCACapable Operator>
class terra::linalg::solvers::TwoGridGCA< ScalarT, Operator >

: Galerkin coarse approximation (GCA). TwoGridGCA takes a coarser and a finer operator. Each thread assembles a coarse-grid gca matrix in the coarser operator on a single hex. To do this, it loops the finer hexes of the coarse hex and its respective wedges. It computes the interpolation matrix P mapping from coarse wedge to the current fine wedge, computes the triple-product P^TAP with the fine-operator local matrix A and adds the resulting gca matrix up for all fine wedges comprising the coarse wedge. Finally, it stores the result in the wedge-wise matrix storage of the coarse operator.

Member Typedef Documentation

◆ DstVectorType

template<typename ScalarT , terra::linalg::GCACapable Operator>
using terra::linalg::solvers::TwoGridGCA< ScalarT, Operator >::DstVectorType = linalg::VectorQ1Scalar< double >

◆ ScalarType

template<typename ScalarT , terra::linalg::GCACapable Operator>
using terra::linalg::solvers::TwoGridGCA< ScalarT, Operator >::ScalarType = ScalarT

◆ SrcVectorType

template<typename ScalarT , terra::linalg::GCACapable Operator>
using terra::linalg::solvers::TwoGridGCA< ScalarT, Operator >::SrcVectorType = linalg::VectorQ1Scalar< double >

Constructor & Destructor Documentation

◆ TwoGridGCA()

template<typename ScalarT , terra::linalg::GCACapable Operator>
terra::linalg::solvers::TwoGridGCA< ScalarT, Operator >::TwoGridGCA ( Operator  fine_op,
Operator  coarse_op,
int  level_range,
grid::Grid4DDataScalar< ScalarType GCAElements,
bool  treat_boundary = true,
InterpolationMode  interpolation_mode = InterpolationMode::Constant 
)
inlineexplicit

GCA Ctor Assembles Galerkin coarse-grid operators in the coarse-op passed.

Parameters
fine_opoperator on the finer grid to derive the coarse-grid operators from
coarse_opoperator on the coarser grid to store the coarse-grid operators in
level_rangemax_level - min_level range used in the app: required check whether a certain element is a child of a GCA element.
GCAElementsmap of coarsest-grid elements, on which GCA should be used. Using this and level_range, the GCA can check for a certain element whether it is a child of a marked coarsest-grid element. If that is the case, GCA is applied to it.

Member Function Documentation

◆ operator()()

template<typename ScalarT , terra::linalg::GCACapable Operator>
void terra::linalg::solvers::TwoGridGCA< ScalarT, Operator >::operator() ( const int  local_subdomain_id,
const int  x_coarse_idx,
const int  y_coarse_idx,
const int  r_coarse_idx 
) const
inline

◆ wedge_vertex_indices()

template<typename ScalarT , terra::linalg::GCACapable Operator>
void terra::linalg::solvers::TwoGridGCA< ScalarT, Operator >::wedge_vertex_indices ( dense::Vec< int, 4 >  hex_idx,
int  wedge,
dense::Vec< int, 4 >(&)  wedge_local_vertex_indices[6] 
) const
inline

Computes indices of vertices associated to a wedge in a hex cell.

Parameters
coarse_hex_idx[in] global index of the hex cell
wedge[in] wedge index (local index 0 or 1)
wedge_local_vertex_indices[out] global indices of the vertices located on the wedge

The documentation for this class was generated from the following file: