Evaluates System Matrix and RHS of the linear System. Valid for Neumann-type & Dirichlet-type Boundary Conditions. Coefficients are evaluated here and discarded after use.
46 DOUBLE bb,cc,dd,thetac,estar;
85 DOUBLE source,doublet,ratelet;
86 struct panel4* mpi_elements;
89 MPI_Group* mpi_row_groups;
90 MPI_Group mpi_group_world;
118 #ifdef _ACOUSTO_DEBUG 119 cmatfile = fopen(
"CD.matrix.out",
"w");
120 fprintf(cmatfile,
"CD=[");
125 cstride = locRows * locCols;
131 for(i = 0; i < locRows*locCols; i++)
143 pzgemr2d_(&gCRows,&ione,
solution->
vecPsiu ,&ione, &ione,descpsiu, psiuvec ,&ione,&ione,descgpsiu,&
runinfo->
ctxt);
144 pzgemr2d_(&gCRows,&ione,
solution->
vecPsinc,&ione, &ione,descpsiu, psincvec,&ione,&ione,descgpsiu,&
runinfo->
ctxt);
145 pzgemr2d_(&gCRows,&ione,
solution->
vecPhinc,&ione, &ione,descpsiu, phincvec,&ione,&ione,descgpsiu,&
runinfo->
ctxt);
156 for(i=0;i<locRows;i++){
170 for(j=0;j<locCols;j++){
174 estar = (icntr == ielmu ) ? 0.5 : 0.0;
179 ielmb = ielmu + is*mpi_nelmu;
181 kode = (ielmb == icntr) ? 1 : 0;
183 delaya(&theta,ielmb,&mpi_elements[ielmb],mpi_cntr[icntr]);
184 intgba(1, 0, kode, &mpi_cntr[icntr], &mpi_elements[ielmb], &source, &doublet, &ratelet);
190 cexpc =
CEXP(-cfreq*thetac);
192 vec_copy(&un,mpi_elements[ielmb].n);
196 gamma_over_lambda = gamma/lambda;
197 lambda_over_gamma = lambda/gamma;
202 matval = (cc+cfreq*dd) * cexpc ;
215 if (
modsolinfo->
dirneu == 2)
solution->
rhs[i] += bb * cexpc*((func+gdotn)/lambda - phincvec[ielmu]*gamma_over_lambda - psincvec[ielmu]);
223 #ifdef _ACOUSTO_DEBUG 234 #ifdef _ACOUSTO_DEBUG 235 fprintf(cmatfile,
";\n");
242 #ifdef _ACOUSTO_DEBUG 243 fprintf(cmatfile,
"];\n");
253 MPI_Comm_group(MPI_COMM_WORLD, &mpi_group_world);
258 MPI_Group_incl(mpi_group_world,
runinfo->
npcols,row_ranks,&mpi_row_groups[i]);
259 MPI_Comm_create(MPI_COMM_WORLD, mpi_row_groups[i], &mpi_comm[i]);
264 if(MPI_COMM_NULL != mpi_comm[i]){
275 for(i=0;i<locRows;i++){
287 if(psiuvec) free(psiuvec);
288 if(psincvec) free(psincvec);
289 if(phincvec) free(phincvec);
291 #ifdef _ACOUSTO_DEBUG 296 f = fopen(fname,
"w");
297 for(i=0;i<locRows;i++){
299 for(j=0;j<locCols;j++){
310 f = fopen(fname,
"w");
311 for(i=0;i<locRows;i++){
313 fprintf(f,
"%f %f %f %f %f %f\n",
324 #undef _ACOUSTO_DEBUG 326 #ifdef _ACOUSTO_DEBUG 330 f = fopen(fname,
"w");
331 for(i=0;i<locRows;i++){
333 fprintf(f,
"%f %f %f %f %f %f\n",
344 #undef _ACOUSTO_DEBUG struct run_info * runinfo
Definition: globals.h:34
#define Vec
Definition: types.h:63
int npcols
Definition: structs.h:113
int ncntr
Definition: structs.h:299
DOUBLE vsound
Definition: structs.h:102
COMPLEX * matY
Definition: structs.h:603
MPI_Datatype mpi_complex
Definition: globals.h:93
#define CREAL(x)
Definition: functions.h:49
void delaya(DOUBLE *theta, int ielmb, struct panel4 *element, struct vector xc)
Definition: integrals.c:268
#define MPI_ACOUSTO_COMPLEX
Definition: types.h:56
Vec vecPsinc
Definition: structs.h:580
int myrow
Definition: structs.h:115
void vec_copy(struct vector *vdest, const struct vector vsrc)
Definition: math.c:158
int nprows
Definition: structs.h:111
vector struct to hold triplets.
Definition: structs.h:29
#define CIMAG(x)
Definition: functions.h:50
COMPLEX * lambda
Definition: structs.h:623
int nchief
Definition: structs.h:301
MPI_Op mpi_op_complex_sum
Definition: globals.h:124
#define LOG_INFO
Definition: logger.h:26
void pzgemr2d_(int *m, int *n, COMPLEX *A, int *ia, int *ja, int *desca, COMPLEX *B, int *ib, int *jb, int *descb, int *ictxt)
Copies a (m x n) submatrix of A from element (ia,ja) on a submatrix of B from element (ib...
struct bc_struct bc
Definition: globals.h:54
int nelmb
Definition: structs.h:295
#define CEXP(x)
Definition: functions.h:48
Vec vecPhinc
Definition: structs.h:578
#define COMPLEX_ZERO
Definition: constants.h:44
int ctxt
Definition: structs.h:109
int knw
Definition: structs.h:446
Definition of a quadrilateral panel.
Definition: structs.h:44
void descinit_(int *desc, int *m, int *n, int *mb, int *nb, int *ia, int *ja, int *ictxt, int *llda, int *info)
struct solution_struct * solution
Definition: globals.h:52
#define COMPLEX
Definition: types.h:48
#define CABS(x)
Definition: functions.h:51
Vec vecPsiu
Definition: structs.h:584
struct modsol_info * modsolinfo
Definition: globals.h:44
DOUBLE z
Definition: structs.h:35
struct vector g
Definition: structs.h:626
DOUBLE vec_dot(struct vector v1, struct vector v2)
Definition: math.c:34
COMPLEX * gamma
Definition: structs.h:624
int mycol
Definition: structs.h:117
int nsymm
Definition: structs.h:97
double DOUBLE
Definition: types.h:44
int numroc_(int *m, int *mb, int *p, int *ia, int *npr)
DOUBLE x
Definition: structs.h:31
#define CREATE_VEC(v, lsize)
Definition: allocation.h:90
int col_block_size
Definition: structs.h:121
COMPLEX * func
Definition: structs.h:625
void intgba(int kcrce, int kelem, int kode, struct vector *xcntr, struct panel4 *element, DOUBLE *source, DOUBLE *doublet, DOUBLE *ratelet)
Definition: integrals.c:40
Geometry info structure.
Definition: structs.h:161
COMPLEX * rhs
Definition: structs.h:605
int row_block_size
Definition: structs.h:119
void logger(int level, char *msg,...)
Definition: logger.c:56
#define calloc(n, size)
Definition: allocation.h:37
struct modgeom_info * modgeominfo
Definition: globals.h:38
void sc_l2g(int il, int p, int n, int np, int nb, int *i)
Definition: matutils.c:116
#define VecZeroEntries(V, n)
Definition: allocation.h:99
DOUBLE y
Definition: structs.h:33
int dirneu
Definition: structs.h:444