Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions
Xxt Namespace Reference

Classes

struct  comm
 
struct  crs_data
 
struct  csr_mat
 
struct  sparse_cholesky
 

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

typedef int Xxt::comm_ext

Definition at line 57 of file Xxt.hpp.

typedef int Xxt::comm_req

Definition at line 58 of file Xxt.hpp.

Function Documentation

static void Xxt::Finalise ( crs_data *  pCrs)
inlinestatic

Deallocates the crs mapping data.

Definition at line 201 of file Xxt.hpp.

References nektar_crs_free().

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

202  {
203 #ifdef NEKTAR_USE_MPI
204  int finalized;
205  MPI_Finalized(&finalized);
206  if (pCrs && !finalized)
207  {
208  nektar_crs_free(pCrs);
209  }
210 #endif
211  }
void nektar_crs_free(struct crs_data *data)
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 
)
static

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 157 of file Xxt.hpp.

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().

163  {
164 #ifdef NEKTAR_USE_MPI
165  unsigned int nz = pAr.num_elements();
166  LibUtilities::CommMpiSharedPtr vCommMpi = boost::dynamic_pointer_cast<LibUtilities::CommMpi> (pComm);
167  ASSERTL1(vCommMpi, "Failed to cast MPI Comm object.");
168  comm vComm;
169  MPI_Comm_dup(vCommMpi->GetComm(), &vComm.c);
170  vComm.id = vCommMpi->GetRank();
171  vComm.np = vCommMpi->GetSize();
172  crs_data* result = nektar_crs_setup(pRank, &pId[0], nz, &pAi[0],
173  &pAj[0], &pAr[0], 0, &vComm);
174  MPI_Comm_free(&vComm.c);
175  return result;
176 #else
177  return 0;
178 #endif
179  }
boost::shared_ptr< CommMpi > CommMpiSharedPtr
Pointer to a Communicator object.
Definition: CommMpi.h:55
A global linear system.
Definition: CommMpi.h:61
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)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
void Xxt::nektar_crs_free ( struct crs_data *  data)

Referenced by Finalise().

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().

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

Referenced by Solve().

void Xxt::nektar_crs_stats ( struct crs_data *  data)
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 185 of file Xxt.hpp.

References nektar_crs_solve().

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

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