Nektar++
Classes | Typedefs | Functions
Xxt Namespace Reference

Classes

struct  comm
 
struct  sparse_cholesky
 
struct  csr_mat
 
struct  crs_data
 

Typedefs

typedef int comm_ext
 
typedef int comm_req
 

Functions

struct crs_datanektar_crs_setup (unsigned int n, const unsigned long *id, unsigned int nz, const unsigned int *Ai, const unsigned int *Aj, const double *A, unsigned int null_space, const struct comm *comm)
 
void nektar_crs_solve (double *x, struct crs_data *data, double *b)
 
void nektar_crs_stats (struct crs_data *data)
 
void nektar_crs_free (struct crs_data *data)
 
static struct crs_dataInit (unsigned int pRank, const Nektar::Array< OneD, unsigned long > pId, const Nektar::Array< OneD, unsigned int > pAi, const Nektar::Array< OneD, unsigned int > pAj, const Nektar::Array< OneD, NekDouble > pAr, const LibUtilities::CommSharedPtr &pComm)
 Initialise the matrix-solve. More...
 
static void Solve (Nektar::Array< OneD, NekDouble > pX, struct crs_data *pCrs, Nektar::Array< OneD, NekDouble > pB)
 Solve the matrix system for a given input vector b. More...
 
static void Finalise (crs_data *pCrs)
 Deallocates the crs mapping data. More...
 

Typedef Documentation

◆ comm_ext

typedef int Xxt::comm_ext

Definition at line 55 of file Xxt.hpp.

◆ comm_req

typedef int Xxt::comm_req

Definition at line 56 of file Xxt.hpp.

Function Documentation

◆ Finalise()

static void Xxt::Finalise ( crs_data pCrs)
inlinestatic

Deallocates the crs mapping data.

Definition at line 204 of file Xxt.hpp.

205 {
206 #ifdef NEKTAR_USE_MPI
207  int finalized;
208  MPI_Finalized(&finalized);
209  if (pCrs && !finalized)
210  {
211  nektar_crs_free(pCrs);
212  }
213 #endif
214 }
void nektar_crs_free(struct crs_data *data)

References nektar_crs_free().

Referenced by Nektar::MultiRegions::GlobalLinSysXxt::~GlobalLinSysXxt().

◆ Init()

static struct crs_data* Xxt::Init ( unsigned int  pRank,
const Nektar::Array< OneD, unsigned long >  pId,
const Nektar::Array< OneD, unsigned int >  pAi,
const Nektar::Array< OneD, unsigned int >  pAj,
const Nektar::Array< OneD, NekDouble pAr,
const LibUtilities::CommSharedPtr pComm 
)
inlinestatic

Initialise the matrix-solve.

On each process an array of IDs for each global degree of freedom is supplied which corresponds to a unique numbering of universal degrees of freedom. Three vectors describing the matrix are also provided. The parallel matrix solve is then set up.

Parameters
pIdArray of integers providing universal IDs for each global DOF on the process.
pAiRow indices of matrix entries
pAjColumn indices of matrix entries
pArValues of matrix entries
pCommCommunication object used for inter-process communication.
Returns
crs_data structure

Definition at line 160 of file Xxt.hpp.

166 {
167 #ifdef NEKTAR_USE_MPI
168  unsigned int nz = pAr.size();
170  std::dynamic_pointer_cast<LibUtilities::CommMpi>(pComm);
171  ASSERTL1(vCommMpi, "Failed to cast MPI Comm object.");
172  comm vComm;
173  MPI_Comm_dup(vCommMpi->GetComm(), &vComm.c);
174  vComm.id = vCommMpi->GetRank();
175  vComm.np = vCommMpi->GetSize();
176  crs_data *result = nektar_crs_setup(pRank, &pId[0], nz, &pAi[0], &pAj[0],
177  &pAr[0], 0, &vComm);
178  MPI_Comm_free(&vComm.c);
179  return result;
180 #else
181  return 0;
182 #endif
183 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
std::shared_ptr< CommMpi > CommMpiSharedPtr
Pointer to a Communicator object.
Definition: CommMpi.h:55
struct crs_data * nektar_crs_setup(unsigned int n, const unsigned long *id, unsigned int nz, const unsigned int *Ai, const unsigned int *Aj, const double *A, unsigned int null_space, const struct comm *comm)

References ASSERTL1, Xxt::comm::c, Xxt::comm::id, nektar_crs_setup(), and Xxt::comm::np.

Referenced by Nektar::MultiRegions::GlobalLinSysXxtFull::AssembleMatrixArrays(), and Nektar::MultiRegions::GlobalLinSysXxtStaticCond::v_AssembleSchurComplement().

◆ nektar_crs_free()

void Xxt::nektar_crs_free ( struct crs_data data)

Referenced by Finalise().

◆ nektar_crs_setup()

struct crs_data* Xxt::nektar_crs_setup ( unsigned int  n,
const unsigned long *  id,
unsigned int  nz,
const unsigned int *  Ai,
const unsigned int *  Aj,
const double *  A,
unsigned int  null_space,
const struct comm comm 
)

Referenced by Init().

◆ nektar_crs_solve()

void Xxt::nektar_crs_solve ( double *  x,
struct crs_data data,
double *  b 
)

Referenced by Solve().

◆ nektar_crs_stats()

void Xxt::nektar_crs_stats ( struct crs_data data)

◆ Solve()

static void Xxt::Solve ( Nektar::Array< OneD, NekDouble pX,
struct crs_data pCrs,
Nektar::Array< OneD, NekDouble pB 
)
inlinestatic

Solve the matrix system for a given input vector b.

Definition at line 188 of file Xxt.hpp.

191 {
192 #ifdef NEKTAR_USE_MPI
193  if (!pCrs)
194  {
195  return;
196  }
197  nektar_crs_solve(&pX[0], pCrs, &pB[0]);
198 #endif
199 }
void nektar_crs_solve(double *x, struct crs_data *data, double *b)

References nektar_crs_solve().

Referenced by Nektar::MultiRegions::GlobalLinSysXxt::v_SolveLinearSystem().