GEOS
|
#include "common/DataTypes.hpp"
#include "linearAlgebra/common/LinearOperator.hpp"
#include "linearAlgebra/multiscale/mesh/MeshObjectManager.hpp"
#include "linearAlgebra/utilities/LinearSolverParameters.hpp"
#include "linearAlgebra/utilities/TransposeOperator.hpp"
#include "mesh/DomainPartition.hpp"
#include "mesh/mpiCommunications/CommunicationTools.hpp"
Go to the source code of this file.
Namespaces | |
geos | |
Functions | |
ArrayOfSets< localIndex > | geos::multiscale::msrsb::buildLocalConnectivity (MeshObjectManager const &nodeManager, bool ghostNodes, MeshObjectManager const &dualManager, bool ghostDuals) |
Construct a local adjacency map between points (e.g. vertices) connected by duals (e.g. cells). More... | |
array1d< localIndex > | geos::multiscale::msrsb::makeSeededPartition (ArrayOfSetsView< localIndex const > const &connectivity, arrayView1d< localIndex const > const &seeds, ArrayOfSetsView< localIndex const > const &supports) |
Construct a non-overlapping partitioning (clustering) of points using point connectivity and a set of partition seeds. More... | |
ArrayOfSets< localIndex > | geos::multiscale::msrsb::buildSupports (ArrayOfSetsView< localIndex const > const &fineObjectToSubdomain, ArrayOfSetsView< localIndex const > const &subdomainToCoarseObject, ArrayOfSetsView< localIndex const > const &coarseObjectToSubdomain) |
Build a map of support regions through subdomain adjacency. More... | |
array1d< integer > | geos::multiscale::msrsb::findGlobalSupportBoundary (ArrayOfSetsView< localIndex const > const &fineObjectToSubdomain) |
Compute an array of global support boundary indicators. More... | |
SparsityPattern< globalIndex > | geos::multiscale::msrsb::buildProlongationSparsity (DofManager const &fineDofManager, DofManager const &coarseDofManager, string const &fieldName, ArrayOfSetsView< localIndex const > const &supports) |
Compute the sparsity pattern of the prolongation operator. More... | |
CRSMatrix< real64, globalIndex > | geos::multiscale::msrsb::buildTentativeProlongation (DofManager const &fineDofManager, DofManager const &coarseDofManager, string const &fieldName, ArrayOfSetsView< localIndex const > const &supports, arrayView1d< localIndex const > const &initPart) |
Initialize a tentative prolongation operator according to a non-overlapping partitioning of points. More... | |
void | geos::multiscale::msrsb::makeGlobalDofLists (DofManager const &dofManager, string const &fieldName, arrayView1d< integer const > const &indicator, array1d< globalIndex > &boundaryDof, array1d< globalIndex > &interiorDof) |
Build lists of boundary and interior dof indices to use in MsRSB basis smoothing iteration. More... | |
ArrayOfSets< localIndex > | geos::multiscale::msrsb::buildLayeredSupport (integer numLayers, ArrayOfSetsView< localIndex const > const &connectivity, arrayView1d< localIndex const > const &initialPartition) |
Build (possibly overlapping) supports consisting of a fixed number of layers added to initial (non-overlapping) partitions. More... | |
array1d< integer > | geos::multiscale::msrsb::findLayeredSupportBoundary (ArrayOfSetsView< localIndex const > const &connectivity, ArrayOfSetsView< localIndex const > const &support) |
Given a layered support, find the global support boundary. More... | |
template<typename MATRIX > | |
std::unique_ptr< LinearOperator< typename MATRIX::Vector > > | geos::multiscale::msrsb::makeRestriction (LinearSolverParameters::Multiscale const ¶ms, MATRIX const &prolongation) |
Make a restriction operator. More... | |
CRSMatrix< real64, globalIndex > | geos::multiscale::msrsb::dropEntries (CRSMatrixView< real64 const, globalIndex const > const &mat, real64 relTol) |
Drop entries from the matrix that are below relTol times max abs value in current row. More... | |
template<typename MATRIX > | |
MATRIX | geos::multiscale::msrsb::computeRAP (LinearSolverParameters::Multiscale const ¶ms, MATRIX const &fineMatrix, MATRIX const &prolongation, LinearOperator< typename MATRIX::Vector > const &restrictionOp) |
Compute the triple product R*A*P with optional post-filtering. More... | |
void | geos::multiscale::msrsb::writeProlongation (CRSMatrixView< real64 const, globalIndex const > const &prolongation, multiscale::DofManager const &dofManager, string const &fieldName, string const &prefix, multiscale::MeshLevel &mesh, multiscale::MeshObjectManager &fineManager, std::function< void(multiscale::MeshLevel &, std::vector< string > const &) > const &writeFunc) |
Write the prolongation operator as a collection of fine-level fields (one per coarse point) More... | |
Contains various utility functions used by MsRSB level builders.
Definition in file MsrsbUtils.hpp.
ArrayOfSets< localIndex > geos::multiscale::msrsb::buildLayeredSupport | ( | integer | numLayers, |
ArrayOfSetsView< localIndex const > const & | connectivity, | ||
arrayView1d< localIndex const > const & | initialPartition | ||
) |
Build (possibly overlapping) supports consisting of a fixed number of layers added to initial (non-overlapping) partitions.
numLayers | number of layers to add |
connectivity | point connectivity map |
initialPartition | initial non-overlapping partition of the points |
ArrayOfSets< localIndex > geos::multiscale::msrsb::buildLocalConnectivity | ( | MeshObjectManager const & | nodeManager, |
bool | ghostNodes, | ||
MeshObjectManager const & | dualManager, | ||
bool | ghostDuals | ||
) |
Construct a local adjacency map between points (e.g. vertices) connected by duals (e.g. cells).
nodeManager | object manager for points (nodes) |
ghostNodes | whether to include ghosted points in the map |
dualManager | object manager for duals (cells) |
ghostDuals | whether to include connections via ghosted duals |
SparsityPattern< globalIndex > geos::multiscale::msrsb::buildProlongationSparsity | ( | DofManager const & | fineDofManager, |
DofManager const & | coarseDofManager, | ||
string const & | fieldName, | ||
ArrayOfSetsView< localIndex const > const & | supports | ||
) |
Compute the sparsity pattern of the prolongation operator.
fineDofManager | fine level DofManager |
coarseDofManager | coarse level DofManager |
fieldName | dof field name to extract info from DofManagers |
supports | support map (for each fine point, a list of coarse points that interpolate it) |
ArrayOfSets< localIndex > geos::multiscale::msrsb::buildSupports | ( | ArrayOfSetsView< localIndex const > const & | fineObjectToSubdomain, |
ArrayOfSetsView< localIndex const > const & | subdomainToCoarseObject, | ||
ArrayOfSetsView< localIndex const > const & | coarseObjectToSubdomain | ||
) |
Build a map of support regions through subdomain adjacency.
fineObjectToSubdomain | map of fine-scale objects (points) to adjacent subdomains ("virtual" boundary subdomains, if included, must have negative indices) |
subdomainToCoarseObject | map of subdomains to adjacent coarse-scale objects (points). Does not need to include boundary subdomains. |
coarseObjectToSubdomain | map of coarse-scale objects (points) to adjacent subdomains (generally a transpose of subdomainToCoarseObject ) |
CRSMatrix< real64, globalIndex > geos::multiscale::msrsb::buildTentativeProlongation | ( | DofManager const & | fineDofManager, |
DofManager const & | coarseDofManager, | ||
string const & | fieldName, | ||
ArrayOfSetsView< localIndex const > const & | supports, | ||
arrayView1d< localIndex const > const & | initPart | ||
) |
Initialize a tentative prolongation operator according to a non-overlapping partitioning of points.
fineDofManager | fine level DofManager |
coarseDofManager | coarse level DofManager |
fieldName | field name for the dof registered in DofManager |
supports | support map (for each fine point, a list of coarse points that interpolate it) |
initPart | non-overlapping partition of fine points that defines the initial interpolation |
MATRIX geos::multiscale::msrsb::computeRAP | ( | LinearSolverParameters::Multiscale const & | params, |
MATRIX const & | fineMatrix, | ||
MATRIX const & | prolongation, | ||
LinearOperator< typename MATRIX::Vector > const & | restrictionOp | ||
) |
Compute the triple product R*A*P with optional post-filtering.
MATRIX | type of sparse matrix |
params | multiscale parameters |
fineMatrix | the fine-scale system matrix |
prolongation | the prolongation operator |
restrictionOp | the restriction operator |
Definition at line 211 of file MsrsbUtils.hpp.
CRSMatrix< real64, globalIndex > geos::multiscale::msrsb::dropEntries | ( | CRSMatrixView< real64 const, globalIndex const > const & | mat, |
real64 | relTol | ||
) |
Drop entries from the matrix that are below relTol
times max abs value in current row.
mat | tne input matrix view |
relTol | relative tolerance parameter |
array1d< integer > geos::multiscale::msrsb::findGlobalSupportBoundary | ( | ArrayOfSetsView< localIndex const > const & | fineObjectToSubdomain | ) |
Compute an array of global support boundary indicators.
fineObjectToSubdomain | an adjacency map of fine mesh support points to coarse subdomains |
array1d< integer > geos::multiscale::msrsb::findLayeredSupportBoundary | ( | ArrayOfSetsView< localIndex const > const & | connectivity, |
ArrayOfSetsView< localIndex const > const & | support | ||
) |
Given a layered support, find the global support boundary.
connectivity | point connectivity map |
support | support map (for each fine point, a list of coarse points that interpolate it) |
void geos::multiscale::msrsb::makeGlobalDofLists | ( | DofManager const & | dofManager, |
string const & | fieldName, | ||
arrayView1d< integer const > const & | indicator, | ||
array1d< globalIndex > & | boundaryDof, | ||
array1d< globalIndex > & | interiorDof | ||
) |
Build lists of boundary and interior dof indices to use in MsRSB basis smoothing iteration.
dofManager | the current level DofManager |
fieldName | field name for the dof registered in DofManager |
indicator | indicator array with 1s indicating global support boundary points |
boundaryDof | an output array to be populated with a list of locally present boundary dof indices |
interiorDof | an output array to be populated with a list of locally present interior dof indices |
std::unique_ptr< LinearOperator< typename MATRIX::Vector > > geos::multiscale::msrsb::makeRestriction | ( | LinearSolverParameters::Multiscale const & | params, |
MATRIX const & | prolongation | ||
) |
Make a restriction operator.
MATRIX | type of sparse matrix |
params | multiscale parameters |
prolongation | the prolongation operator |
The operator returned may be an explicit matrix or an implicit operator wrapping prolongation
, which must have appropriate lifetime.
Definition at line 171 of file MsrsbUtils.hpp.
array1d< localIndex > geos::multiscale::msrsb::makeSeededPartition | ( | ArrayOfSetsView< localIndex const > const & | connectivity, |
arrayView1d< localIndex const > const & | seeds, | ||
ArrayOfSetsView< localIndex const > const & | supports | ||
) |
Construct a non-overlapping partitioning (clustering) of points using point connectivity and a set of partition seeds.
connectivity | the point connectivity graph |
seeds | a list of seed point indices, corresponding to the number of desired partitions |
supports | support regions for each partition, i.e. a set of points that the partition is constrained to (if empty, partition growth is unconstrained) |
void geos::multiscale::msrsb::writeProlongation | ( | CRSMatrixView< real64 const, globalIndex const > const & | prolongation, |
multiscale::DofManager const & | dofManager, | ||
string const & | fieldName, | ||
string const & | prefix, | ||
multiscale::MeshLevel & | mesh, | ||
multiscale::MeshObjectManager & | fineManager, | ||
std::function< void(multiscale::MeshLevel &, std::vector< string > const &) > const & | writeFunc | ||
) |
Write the prolongation operator as a collection of fine-level fields (one per coarse point)
prolongation | the local prolongation operator |
dofManager | the fine-scale DofManager |
fieldName | the dof field name registered in DofManager |
prefix | string prefix to use for all field names |
mesh | the fine-scale mesh |
fineManager | the fine-scale object manager to write fields into |
writeFunc | the callback that will be triggered once all fields have been registered on mesh and written to and before they are remove, and passed the list of field names (keys). This can be used to propagate data further to finer level (or the original GEOS mesh). |
This function should only be used for debugging purposes (e.g. to dump basis functions to 3d plot outputs). It is very slow as it has to write a massive amount of data.