Changeset e24bbb for pcp/src/output.c


Ignore:
Timestamp:
Apr 21, 2008, 3:33:52 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
48cbc9
Parents:
d8bb59
Message:

PlotRealDensity(): nodes now calculated via ReciBasis-matrix multiplication

We introcude cartesian coordinate in the config file which is then transformed to integer cell (node) coordinate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pcp/src/output.c

    rd8bb59 re24bbb  
    17351735  int PE, zahl;
    17361736  double *buffer;
    1737   int node = ceil(n_orth/Lat->RealBasisQ[index]*N[index]);
    17381737  MPI_Status status;
    17391738  int sizes[P->Par.Max_me_comm_ST_Psi], c0, c1;
     1739  double nodes[NDIM], node[NDIM];
     1740 
     1741  for(i=0;i<NDIM;i++) {
     1742    nodes[i] = (i == index) ? n_orth : 0.;
     1743    node[i] = 0.;
     1744  }
     1745  RMat33Vec3(node, Lat->ReciBasis, nodes);  // transform cartesian coordinates into cell coordinates [0,1]^3
     1746  for(i=0;i<NDIM;i++) // now N^3 within node range of discrete grid
     1747    node[i] = (int)(node[i]*N[i]/(2.*PI));
     1748  fprintf(stderr,"(%i) n_orth %lg, index %i converted to plane offset vector (%lg, %lg, %lg).\n", P->Par.me, n_orth, index, node[0], node[1], node[2]);
    17401749 
    17411750  switch (index) {
     
    17501759      break;
    17511760  }
     1761  fprintf(stderr,"(%i) buffer size %i\n", P->Par.me, zahl);
    17521762  buffer = Malloc(sizeof(double)*zahl,"PlotRealDensity: buffer");
    17531763 
     
    17551765  c1 = cross(index,1);
    17561766  // then for every point on the grid in real space ...
     1767  i=0;
    17571768  for (n0=0;n0<N0;n0++)  // only local points on x axis
    17581769    for (n[1]=0;n[1]<N[1];n[1]++)
    17591770      for (n[2]=0;n[2]<N[2];n[2]++) {
    17601771        n[0]=n0 + N0*myPE; // global relative coordinate: due to partitoning of x-axis in PEPGamma>1 case
    1761         if (n[index] == node) { // only on the correct plane orthogonal to desired axis and at desired node ...
     1772        if (n[index] == (int)node[index]) { // only on the correct plane orthogonal to desired axis and at desired node ...
    17621773          fac[0] = (double)n[0]/(double)N[0];
    17631774          fac[1] = (double)n[1]/(double)N[1];
Note: See TracChangeset for help on using the changeset viewer.