#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <arrayfunctions.h>
#include <mpivars_cpp.h>
#include <simulation_object.h>
#include <petscinterface_struct.h>
Go to the source code of this file.
int PetscCreatePointList |
( |
void * |
obj | ) |
|
Create a list of computational points for each simulation domain: This is a list of all the grid points on which the PDE is solved. Thus, it is the total number of grid points minus the ghost points and blanked out points.
Note: this list is local, not global.
- Parameters
-
Definition at line 25 of file PetscCreatePointList.cpp.
30 int nsims = ctxt->
nsims;
36 ctxt->
offsets = (
int*) calloc(nsims,
sizeof(
int));
37 for (
int ns = 0; ns < nsims; ns++) {
44 ctxt->
points.resize(nsims,
nullptr);
46 for (
int ns = 0; ns < nsims; ns++) {
49 ctxt->
points[ns] = (
int*) calloc (npoints*nv,
sizeof(
int));
51 const int*
const dim( sim[ns].solver.dim_local );
52 const int ghosts( sim[ns].solver.ghosts );
55 std::vector<int> index(ndims,0);
59 (ctxt->
points[ns]+i*nv)[ndims] = p;
65 fprintf(stderr,
"Error in PetscCreatePointList() on rank %d:\n", sim[ns].mpi.rank);
66 fprintf(stderr,
"Inconsistency in point count - %d, %d.\n",
77 printf(
"PETSc: total number of computational points is %d.\n",global_npoints);
78 printf(
"PETSc: total number of computational DOFs is %d.\n",global_ndofs);
int MPISum_integer(int *, int *, int, void *)
#define _ArrayIncrementIndex_(N, imax, i, done)
std::vector< int * > points
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _ArrayCopy1D_(x, y, size)
Structure containing the variables for time-integration with PETSc.
Structure defining a simulation.