GridforceFullSubGrid Class Reference

#include <GridForceGrid.h>

Inheritance diagram for GridforceFullSubGrid:

GridforceFullBaseGrid List of all members.

Public Member Functions

 GridforceFullSubGrid (GridforceFullBaseGrid *parent_in)
void initialize (SimParameters *simParams, MGridforceParams *mgridParams)
int get_border (void) const
Tensor tensorMult (const Tensor &t1, const Tensor &t2)

Protected Member Functions

void pack (MOStream *msg) const
void unpack (MIStream *msg)
void compute_b (float *b, int *inds, Vector gapscale) const
void addToSubgridsFlat (void)

Protected Attributes

Tensor scale_dV
Tensor scale_d2V
float scale_d3V
GridforceFullBaseGridparent
int pmin [3]
int pmax [3]
GridforceFullMainGridmaingrid
int subgridIdx

Friends

class GridforceFullBaseGrid
class GridforceFullMainGrid

Detailed Description

Definition at line 242 of file GridForceGrid.h.


Constructor & Destructor Documentation

GridforceFullSubGrid::GridforceFullSubGrid ( GridforceFullBaseGrid parent_in  ) 

Definition at line 901 of file GridForceGrid.C.

References DebugM, endi(), GridforceFullBaseGrid::generation, maingrid, and parent.

00901                                                                            {
00902     parent = parent_in;
00903     generation = parent->generation + 1;
00904     GridforceFullBaseGrid *tmp = parent;
00905     while (tmp->generation > 0) {
00906         tmp = ((GridforceFullSubGrid *)tmp)->parent;
00907     }
00908     maingrid = (GridforceFullMainGrid *)tmp;
00909     DebugM(4, "generation = " << generation << "\n" << endi);
00910 }


Member Function Documentation

void GridforceFullSubGrid::addToSubgridsFlat ( void   )  [protected]

Definition at line 1150 of file GridForceGrid.C.

References DebugM, endi(), maingrid, GridforceFullBaseGrid::numSubgrids, subgridIdx, GridforceFullBaseGrid::subgrids, and GridforceFullMainGrid::subgrids_flat.

Referenced by GridforceFullMainGrid::buildSubgridsFlat().

01151 {
01152     DebugM(4, "addToSubgridsFlat() called, subgridIdx = " << subgridIdx << ", maingrid->numSubgrids = " << maingrid->numSubgrids << "\n" << endi);
01153     maingrid->subgrids_flat[subgridIdx-1] = this;
01154     for (int i = 0; i < numSubgrids; i++) {
01155         subgrids[i]->addToSubgridsFlat();
01156     }
01157 }

void GridforceFullSubGrid::compute_b ( float *  b,
int *  inds,
Vector  gapscale 
) const [protected, virtual]

Implements GridforceFullBaseGrid.

Definition at line 1160 of file GridForceGrid.C.

References GridforceFullBaseGrid::compute_a(), GridforceFullBaseGrid::compute_b(), GridforceFullBaseGrid::compute_d2V(), GridforceFullBaseGrid::compute_d3V(), GridforceFullBaseGrid::compute_dV(), GridforceFullBaseGrid::compute_V(), DebugM, GridforceFullBaseGrid::e, endi(), GridforceFullBaseGrid::gap, GridforceFullBaseGrid::get_grid(), GridforceFullBaseGrid::get_grid_d(), GridforceFullBaseGrid::inv, j, GridforceFullBaseGrid::offset, GridforceFullBaseGrid::origin, parent, scale_d2V, scale_d3V, scale_dV, Vector::x, x, Vector::y, y, Vector::z, and z.

01161 {
01162     for (int i0 = 0; i0 < 8; i0++) {
01163         int inds2[3];
01164         
01165         float voff = 0.0;
01166         int bit = 1;    // bit = 2^i1 in the below loop
01167         for (int i1 = 0; i1 < 3; i1++) {
01168             inds2[i1] = (inds[i1] + ((i0 & bit) ? 1 : 0)) % k[i1];
01169             
01170             // Deal with voltage offsets
01171             if (cont[i1] && inds[i1] == (k[i1]-1) && inds2[i1] == 0) {
01172                 voff += offset[i1];
01173                 DebugM(3, "offset[" << i1 << "] = " << offset[i1] << "\n" << endi);
01174             }
01175             
01176             bit <<= 1;  // i.e. multiply by 2
01177         }
01178         
01179         DebugM(3, "inds2 = " << inds2[0] << " " << inds2[1] << " " << inds2[2] << "\n" << endi);
01180         
01181         int d_hi[3] = {1, 1, 1}; 
01182         int d_lo[3] = {1, 1, 1};
01183         float voffs[3];
01184         float dscales[3] = {0.5, 0.5, 0.5};
01185         for (int i1 = 0; i1 < 3; i1++) {
01186             if (inds2[i1] == 0 && cont[i1]) {
01187                 d_lo[i1] = -(k[i1]-1);
01188                 voffs[i1] = offset[i1];
01189                 dscales[i1] = 1.0/(1.0 + gap[i1]) * 1.0/gapscale[i1];
01190             }
01191             else if (inds2[i1] == k[i1]-1 && cont[i1]) {
01192                 d_hi[i1] = -(k[i1]-1);
01193                 voffs[i1] = offset[i1];
01194                 dscales[i1] = 1.0/(1.0 + gap[i1]) * 1.0/gapscale[i1];
01195             }
01196             else {
01197                 voffs[i1] = 0.0;
01198             }
01199         }
01200         
01201         bool edge = false;
01202         for (int i1 = 0; i1 < 3; i1++) {
01203             if (!cont[i1] && (inds2[i1] == 0 || inds2[i1] == k[i1]-1)) {
01204                 edge = true;
01205             }
01206         }
01207         
01208         if (inds2[2] == 0) {
01209 //          DebugM(3, "cont = " << cont[0] << " " << cont[1] << " " << cont[2] << " d_hi = " << d_hi[0] << " " << d_hi[1] << " " << d_hi[2] << " d_lo = " << d_lo[0] << " " << d_lo[1] << " " << d_lo[2] << " dscales = " << dscales[0] << " " << dscales[1] << " " << dscales[2] << "\n" << endi);
01210             DebugM(3, "cont = " << cont[0] << " " << cont[1] << " " << cont[2] << "\n" << endi);
01211         }
01212         
01213         if (edge) {
01214             DebugM(2, "Edge!\n" << endi);
01215             
01216             // Must get derivatives from parent
01217             Position pos = e * Vector(inds2[0], inds2[1], inds2[2]) + origin;   // Gridpoint position in realspace
01218             Vector g = parent->inv * (pos - parent->origin);    // Gridpoint position in parent's gridspace
01219             Vector dg;
01220             int inds3[3];
01221             
01222             DebugM(2, "g = " << g << "\n" << endi);
01223             
01224             for (int i = 0; i < 3; i++) {
01225                 inds3[i] = (int)floor(g[i]);
01226                 dg[i] = g[i] - inds3[i];
01227             }
01228     
01229             float x[4], y[4], z[4];
01230             x[0] = 1; y[0] = 1; z[0] = 1;
01231             for (int j = 1; j < 4; j++) {
01232                 x[j] = x[j-1] * dg.x;
01233                 y[j] = y[j-1] * dg.y;
01234                 z[j] = z[j-1] * dg.z;
01235                 DebugM(1, "x[" << j << "] = " << x[j] << "\n");
01236                 DebugM(1, "y[" << j << "] = " << y[j] << "\n");
01237                 DebugM(1, "z[" << j << "] = " << z[j] << "\n" << endi);
01238             }
01239             
01240             // Compute parent matrices
01241             float b_parent[64];
01242             parent->compute_b(b_parent, inds3, gapscale);
01243             
01244             float a_parent[64];
01245             parent->compute_a(a_parent, b_parent);
01246             
01247             // Compute parent derivatives
01248             float V = parent->compute_V(a_parent, x, y, z);
01249             Vector dV = scale_dV * parent->compute_dV(a_parent, x, y, z);
01250             Vector d2V = scale_d2V * parent->compute_d2V(a_parent, x, y, z);
01251             float d3V = scale_d3V * parent->compute_d3V(a_parent, x, y, z);
01252             
01253             b[i0] = V;
01254             b[8+i0] = dV[0];
01255             b[16+i0] = dV[1];
01256             b[24+i0] = dV[2];
01257             b[32+i0] = d2V[0];
01258             b[40+i0] = d2V[1];
01259             b[48+i0] = d2V[2];
01260             b[56+i0] = d3V;
01261         } else {
01262             b[i0] = get_grid(inds2[0],inds2[1],inds2[2]) + voff;        // V
01263             
01264             b[8+i0]  = dscales[0] * (get_grid_d(inds2[0]+d_hi[0],inds2[1],inds2[2]) - get_grid_d(inds2[0]-d_lo[0],inds2[1],inds2[2]) + voffs[0]);       //  dV/dx
01265             b[16+i0] = dscales[1] * (get_grid_d(inds2[0],inds2[1]+d_hi[1],inds2[2]) - get_grid_d(inds2[0],inds2[1]-d_lo[1],inds2[2]) + voffs[1]);       //  dV/dy
01266             b[24+i0] = dscales[2] * (get_grid_d(inds2[0],inds2[1],inds2[2]+d_hi[2]) - get_grid_d(inds2[0],inds2[1],inds2[2]-d_lo[2]) + voffs[2]);       //  dV/dz
01267             b[32+i0] = dscales[0] * dscales[1]
01268                 * (get_grid_d(inds2[0]+d_hi[0],inds2[1]+d_hi[1],inds2[2]) - get_grid_d(inds2[0]-d_lo[0],inds2[1]+d_hi[1],inds2[2]) -
01269                    get_grid_d(inds2[0]+d_hi[0],inds2[1]-d_lo[1],inds2[2]) + get_grid_d(inds2[0]-d_lo[0],inds2[1]-d_lo[1],inds2[2]));    //  d2V/dxdy
01270             b[40+i0] = dscales[0] * dscales[2]
01271                 * (get_grid_d(inds2[0]+d_hi[0],inds2[1],inds2[2]+d_hi[2]) - get_grid_d(inds2[0]-d_lo[0],inds2[1],inds2[2]+d_hi[2]) -
01272                    get_grid_d(inds2[0]+d_hi[0],inds2[1],inds2[2]-d_lo[2]) + get_grid_d(inds2[0]-d_lo[0],inds2[1],inds2[2]-d_lo[2]));    //  d2V/dxdz
01273             b[48+i0] = dscales[1] * dscales[2]
01274                 * (get_grid_d(inds2[0],inds2[1]+d_hi[1],inds2[2]+d_hi[2]) - get_grid_d(inds2[0],inds2[1]-d_lo[1],inds2[2]+d_hi[2]) -
01275                    get_grid_d(inds2[0],inds2[1]+d_hi[1],inds2[2]-d_lo[2]) + get_grid_d(inds2[0],inds2[1]-d_lo[1],inds2[2]-d_lo[2]));    //  d2V/dydz
01276         
01277             b[56+i0] = dscales[0] * dscales[1] * dscales[2]                                     // d3V/dxdydz
01278                 * (get_grid_d(inds2[0]+d_hi[0],inds2[1]+d_hi[1],inds2[2]+d_hi[2]) - get_grid_d(inds2[0]+d_hi[0],inds2[1]+d_hi[1],inds2[2]-d_lo[2]) -
01279                    get_grid_d(inds2[0]+d_hi[0],inds2[1]-d_lo[1],inds2[2]+d_hi[2]) - get_grid_d(inds2[0]-d_lo[0],inds2[1]+d_hi[1],inds2[2]+d_hi[2]) +
01280                    get_grid_d(inds2[0]+d_hi[0],inds2[1]-d_lo[1],inds2[2]-d_lo[2]) + get_grid_d(inds2[0]-d_lo[0],inds2[1]+d_hi[1],inds2[2]-d_lo[2]) +
01281                    get_grid_d(inds2[0]-d_lo[0],inds2[1]-d_lo[1],inds2[2]+d_hi[2]) - get_grid_d(inds2[0]-d_lo[0],inds2[1]-d_lo[1],inds2[2]-d_lo[2]));
01282         }
01283         
01284         if (inds2[0] == 1 && inds2[1] == 1 && inds2[2] == 0) {
01285             DebugM(1, "Sub V = " << b[i0] << "\n");
01286         
01287             DebugM(1, "Sub dV/dx = " << b[8+i0] << "\n");
01288             DebugM(1, "Sub dV/dy = " << b[16+i0] << "\n");
01289             DebugM(1, "Sub dV/dz = " << b[24+i0] << "\n");
01290         
01291             DebugM(1, "Sub d2V/dxdy = " << b[32+i0] << "\n");
01292             DebugM(1, "Sub d2V/dxdz = " << b[40+i0] << "\n");
01293             DebugM(1, "Sub d2V/dydz = " << b[48+i0] << "\n");
01294         
01295             DebugM(1, "Sub d3V/dxdydz = " << b[56+i0] << "\n" << endi);
01296         }
01297     }
01298 }

int GridforceFullSubGrid::get_border ( void   )  const [inline, virtual]

Implements GridforceFullBaseGrid.

Definition at line 251 of file GridForceGrid.h.

00251 { return 0; }

void GridforceFullSubGrid::initialize ( SimParameters simParams,
MGridforceParams mgridParams 
)

Definition at line 913 of file GridForceGrid.C.

References GridforceFullBaseGrid::checksize, GridforceFullBaseGrid::cont, DebugM, endi(), GridforceFullBaseGrid::factor, FALSE, GridforceFullBaseGrid::generation, GridforceFullBaseGrid::get_border(), MGridforceParams::gridforceCheckSize, MGridforceParams::gridforceScale, MGridforceParams::gridforceVolts, iout, GridforceFullBaseGrid::k, NAMD_die(), parent, pmax, pmin, GridforceFullBaseGrid::poten_fp, GridforceFullBaseGrid::readHeader(), GridforceFullBaseGrid::scale, simParams, and TRUE.

00914 {
00915     int tmp;
00916     char line[256];
00917     long int poten_offset;
00918     
00919     // Skip 'attribute's
00920     DebugM(3, "Skipping 'attribute' keywords...\n" << endi);
00921     char str[256];
00922     do {
00923         poten_offset = ftell(poten_fp);
00924         fscanf(poten_fp, "%s", str);
00925         fgets(line, 256, poten_fp);
00926         DebugM(4, "Read line " << str << " " << line << endi);
00927     } while (strcmp(str, "attribute") == 0);
00928     fseek(poten_fp, poten_offset, SEEK_SET);
00929     
00930     // Skip 'field' object
00931     DebugM(3, "Skipping 'field' object\n" << endi);
00932     fscanf(poten_fp, "object");
00933     int n;
00934     n = fscanf(poten_fp, "\"%[^\"]\" class field\n", str);
00935     if (n == 0) {
00936         n = fscanf(poten_fp, "%d class field\n", &tmp);
00937     }
00938     
00939     if (n == 0) {
00940         NAMD_die("Error reading gridforce grid! Could not find field object!\n");
00941     }
00942     
00943     // Skip 'component's
00944     DebugM(3, "Skipping 'component' keywords\n" << endi);
00945     do {
00946         poten_offset = ftell(poten_fp);
00947         fscanf(poten_fp, "%s", str);
00948         fgets(line, 256, poten_fp);
00949     } while (strcmp(str, "component") == 0);
00950     fseek(poten_fp, poten_offset, SEEK_SET);
00951     
00952     // Read header
00953     readHeader(simParams, mgridParams);
00954     
00955     factor = 1.0;
00956     if (mgridParams->gridforceVolts)
00957     {
00958         factor /= 0.0434;  // convert V -> kcal/mol*e
00959     }
00960     scale = mgridParams->gridforceScale;
00961     checksize = mgridParams->gridforceCheckSize;
00962     
00963     for (int i = 0; i < 3; i++) {
00964         k[i] = k_nopad[i];      // subgrids aren't padded
00965     }
00966     
00967     // Make sure that each subgrid dimension is an integral
00968     // number of spanned supergrid cells. This is to ensure that no
00969     // supergrid nodes land in the middle of a subgrid, because in
00970     // this case forces could not be matched properly.
00971     for (int i = 0; i < 3; i++) {
00972         if ((k[i] - 1) % (pmax[i] - pmin[i] + 1) != 0) {
00973             iout << (k[i] - 1) << " % " << (pmax[i] - pmin[i] + 1) << " != 0\n" << endi;
00974             NAMD_die("Error reading gridforce grid! Subgrid dimensions must be an integral number spanned parent cells!");
00975         }
00976     }
00977     
00978     for (int i = 0; i < 3; i++) {
00979         if (parent->cont[i]) {
00980             cont[i] = (pmin[i] == 0 && pmax[i] == parent->k[i]-2) ? TRUE : FALSE;
00981             DebugM(3, "pmin[" << i << "] = " << pmin[i] << " pmax[" << i << "] = " << pmax[i] << " parent->k[" << i << "] = " << parent->k[i] << " cont[" << i << "] = " << cont[i] << "\n" << endi);
00982         } else {
00983             cont[i] = false;
00984             if (parent->generation == 0) {
00985                 // Add to pmin, pmax since parent got extra gridpoint layer(s) (maybe)
00986                 int brd = parent->get_border();
00987                 pmin[i] += brd;
00988                 pmax[i] += brd;
00989             }
00990         }               
00991     }
00992     
00993     DebugM(4, "pmin = " << pmin[0] << " " << pmin[1] << " " << pmin[2] << "\n");
00994     DebugM(4, "pmax = " << pmax[0] << " " << pmax[1] << " " << pmax[2] << "\n" << endi);
00995     
00996     Vector origin2 = parent->origin + parent->e * Position(pmin[0], pmin[1], pmin[2]);
00997     Vector escale, invscale;
00998     for (int i = 0; i < 3; i++) {
00999         escale[i] = double(pmax[i] - pmin[i] + 1)/(k[i]-1);
01000         invscale[i] = 1.0/escale[i];
01001         if (cont[i]) { pmax[i]++; }
01002     }
01003     Tensor e2 = tensorMult(parent->e, Tensor::diagonal(escale));
01004     
01005     // Check that lattice parameters agree with min and max numbers
01006     // from subgrid hierarchy.
01007     double TOL2 = 1e-4; // Totally arbitrary
01008     if (pow(origin2.x-origin.x, 2) > TOL2 ||
01009         pow(origin2.y-origin.y, 2) > TOL2 ||
01010         pow(origin2.z-origin.z, 2) > TOL2 ||
01011         pow(e2.xx-e.xx, 2) > TOL2 ||
01012         pow(e2.xy-e.xy, 2) > TOL2 ||
01013         pow(e2.xz-e.xz, 2) > TOL2 ||
01014         pow(e2.yx-e.yx, 2) > TOL2 ||
01015         pow(e2.yy-e.yy, 2) > TOL2 ||
01016         pow(e2.yz-e.yz, 2) > TOL2 ||
01017         pow(e2.zx-e.zx, 2) > TOL2 ||
01018         pow(e2.zy-e.zy, 2) > TOL2 ||
01019         pow(e2.zz-e.zz, 2) > TOL2)
01020     {
01021         NAMD_die("Error reading gridforce grid! Subgrid lattice does not match!");
01022     }
01023     
01024     // Overwrite what was read from the header
01025     origin = origin2;
01026     e = e2;
01027     
01028     inv = tensorMult(Tensor::diagonal(invscale), parent->inv);
01029     for (int i = 0; i < 3; i++) {
01030         gap[i] = escale[i] * parent->gap[i];
01031         gapinv[i] = invscale[i] * parent->gapinv[i];
01032         offset[i] = parent->offset[i];
01033     }
01034     center = origin + e * 0.5 * Position(k[0], k[1], k[2]);
01035     
01036     DebugM(4, "origin = " << origin << "\n");
01037     DebugM(4, "e = " << e << "\n");
01038     DebugM(4, "inv = " << inv << "\n");
01039     DebugM(4, "gap = " << gap[0] << " " << gap[2] << " " << gap[2] << " " << "\n");
01040     DebugM(4, "gapinv = " << gapinv[0] << " " << gapinv[2] << " " << gapinv[2] << " " << "\n");
01041     DebugM(4, "numSubgrids = " << numSubgrids << "\n");
01042     DebugM(4, "k = " << k[0] << " " << k[1] << " " << k[2] << "\n");
01043     DebugM(4, "escale = " << escale << "\n");
01044     DebugM(4, "invscale = " << invscale << "\n" << endi);
01045     
01046     /*** Set members ***/
01047     size = k[0] * k[1] * k[2];
01048     dk[0] = k[1] * k[2];
01049     dk[1] = k[2];
01050     dk[2] = 1;
01051     
01052     scale_dV = Tensor::diagonal(escale);
01053     scale_d2V = Tensor::diagonal(Vector(escale.x*escale.y, escale.x*escale.z, escale.y*escale.z));
01054     scale_d3V = escale.x * escale.y * escale.z;
01055     
01056     DebugM(4, "scale_dV = " << scale_dV << "\n");
01057     DebugM(4, "scale_d2V = " << scale_d2V << "\n");
01058     DebugM(4, "scale_d3V = " << scale_d3V << "\n" << endi);
01059     
01060     // Allocate storage for potential and read it
01061     float *grid_tmp = new float[size];
01062     
01063     float tmp2;
01064     DebugM(3, "size_nopad = " << size_nopad << "\n");
01065     for (long int count = 0; count < size_nopad; count++) {
01066 //      poten_offset = ftell(poten_fp);
01067 //      fscanf(poten_fp, "%s", str);
01068 //      fgets(line, 256, poten_fp);
01069 //      DebugM(4, "Read line " << str << " " << line << endi);
01070 //      fseek(poten_fp, poten_offset, SEEK_SET);
01071         
01072         int err = fscanf(poten_fp, "%f", &tmp2);
01073         if (err == EOF || err == 0) {
01074             NAMD_die("Grid force potential file incorrectly formatted");
01075         }
01076         grid_tmp[count] = tmp2 * factor;
01077     }
01078     fscanf(poten_fp, "\n");
01079     
01080     // Set real grid
01081     DebugM(3, "allocating grid\n" << endi);
01082     delete[] grid;
01083     grid = new float[size];
01084     for (int i0 = 0; i0 < k_nopad[0]; i0++) {
01085         for (int i1 = 0; i1 < k_nopad[1]; i1++) {
01086             for (int i2 = 0; i2 < k_nopad[2]; i2++) {
01087                 long int ind = i0*dk[0] + i1*dk[1] + i2*dk[2];
01088                 set_grid(i0, i1, i2, grid_tmp[ind]);
01089             }
01090         }
01091     }
01092     
01093     for (int i0 = 0; i0 < k[0]; i0++) {
01094         for (int i1 = 0; i1 < k[1]; i1++) {
01095             for (int i2 = 0; i2 < k[2]; i2++) {
01096                 DebugM(1, "grid[" << i0 << ", " << i1 << ", " << i2 << "] = " << get_grid(i0,i1,i2) << "\n" << endi);
01097             }
01098         }
01099     }
01100     
01101     // Clean up
01102     delete[] grid_tmp;
01103     
01104     // Call initialize for each subgrid
01105     for (int i = 0; i < numSubgrids; i++) {
01106         subgrids[i]->initialize(simParams, mgridParams);
01107     }
01108 }

void GridforceFullSubGrid::pack ( MOStream msg  )  const [protected, virtual]

Reimplemented from GridforceFullBaseGrid.

Definition at line 1111 of file GridForceGrid.C.

References DebugM, endi(), GridforceFullBaseGrid::pack(), pmax, pmin, MOStream::put(), scale_d2V, scale_d3V, scale_dV, and subgridIdx.

01112 {
01113     DebugM(4, "Packing subgrid\n" << endi);
01114     
01115     msg->put(sizeof(Tensor), (char*)&scale_dV);
01116     msg->put(sizeof(Tensor), (char*)&scale_d2V);
01117     msg->put(sizeof(float), (char*)&scale_d3V);
01118     
01119     msg->put(3*sizeof(int), (char*)pmin);
01120     msg->put(3*sizeof(int), (char*)pmax);
01121     msg->put(subgridIdx);
01122     
01123     DebugM(3, "calling GridforceFullBaseGrid::pack\n" << endi);
01124     
01125     GridforceFullBaseGrid::pack(msg);
01126 }

Tensor GridforceFullSubGrid::tensorMult ( const Tensor t1,
const Tensor t2 
) [inline]

Definition at line 253 of file GridForceGrid.h.

References Tensor::xx, Tensor::xy, Tensor::xz, Tensor::yx, Tensor::yy, Tensor::yz, Tensor::zx, Tensor::zy, and Tensor::zz.

00253                                                                   {
00254         Tensor tmp;
00255         tmp.xx = t1.xx * t2.xx + t1.xy * t2.yx + t1.xz * t2.zx;
00256         tmp.xy = t1.xx * t2.xy + t1.xy * t2.yy + t1.xz * t2.zy;
00257         tmp.xz = t1.xx * t2.xz + t1.xy * t2.yz + t1.xz * t2.zz;
00258         tmp.yx = t1.yx * t2.xx + t1.yy * t2.yx + t1.yz * t2.zx;
00259         tmp.yy = t1.yx * t2.xy + t1.yy * t2.yy + t1.yz * t2.zy;
00260         tmp.yz = t1.yx * t2.xz + t1.yy * t2.yz + t1.yz * t2.zz;
00261         tmp.zx = t1.zx * t2.xx + t1.zy * t2.yx + t1.zz * t2.zx;
00262         tmp.zy = t1.zx * t2.xy + t1.zy * t2.yy + t1.zz * t2.zy;
00263         tmp.zz = t1.zx * t2.xz + t1.zy * t2.yz + t1.zz * t2.zz;
00264         return tmp;
00265     }

void GridforceFullSubGrid::unpack ( MIStream msg  )  [protected, virtual]

Reimplemented from GridforceFullBaseGrid.

Definition at line 1129 of file GridForceGrid.C.

References DebugM, endi(), GridforceFullBaseGrid::gapinv, GridforceFullBaseGrid::generation, MIStream::get(), pmax, pmin, scale_d2V, scale_d3V, scale_dV, GridforceFullBaseGrid::size, subgridIdx, and GridforceFullBaseGrid::unpack().

Referenced by GridforceFullBaseGrid::unpack().

01130 {
01131     DebugM(4, "Unpacking subgrid\n" << endi);
01132     
01133     msg->get(sizeof(Tensor), (char*)&scale_dV);
01134     msg->get(sizeof(Tensor), (char*)&scale_d2V);
01135     msg->get(sizeof(float), (char*)&scale_d3V);
01136     
01137     msg->get(3*sizeof(int), (char*)pmin);
01138     msg->get(3*sizeof(int), (char*)pmax);
01139     msg->get(subgridIdx);
01140     
01141     GridforceFullBaseGrid::unpack(msg);
01142     
01143     DebugM(4, "size  = " << size << "\n");
01144     DebugM(4, "numSubgrids = " << numSubgrids << "\n");
01145     DebugM(4, "gapinv = " << gapinv[0] << " " << gapinv[2] << " " << gapinv[2] << " " << "\n");
01146     DebugM(4, "generation = " << generation << "\n" << endi);
01147 }


Friends And Related Function Documentation

friend class GridforceFullBaseGrid [friend]

Definition at line 243 of file GridForceGrid.h.

friend class GridforceFullMainGrid [friend]

Reimplemented from GridforceFullBaseGrid.

Definition at line 244 of file GridForceGrid.h.


Member Data Documentation

GridforceFullMainGrid* GridforceFullSubGrid::maingrid [protected]

Definition at line 282 of file GridForceGrid.h.

Referenced by addToSubgridsFlat(), and GridforceFullSubGrid().

GridforceFullBaseGrid* GridforceFullSubGrid::parent [protected]

Definition at line 280 of file GridForceGrid.h.

Referenced by compute_b(), GridforceFullSubGrid(), and initialize().

int GridforceFullSubGrid::pmax[3] [protected]

Definition at line 281 of file GridForceGrid.h.

Referenced by initialize(), pack(), and unpack().

int GridforceFullSubGrid::pmin[3] [protected]

Definition at line 281 of file GridForceGrid.h.

Referenced by initialize(), pack(), and unpack().

Tensor GridforceFullSubGrid::scale_d2V [protected]

Definition at line 277 of file GridForceGrid.h.

Referenced by compute_b(), pack(), and unpack().

float GridforceFullSubGrid::scale_d3V [protected]

Definition at line 278 of file GridForceGrid.h.

Referenced by compute_b(), pack(), and unpack().

Tensor GridforceFullSubGrid::scale_dV [protected]

Definition at line 276 of file GridForceGrid.h.

Referenced by compute_b(), pack(), and unpack().

int GridforceFullSubGrid::subgridIdx [protected]

Definition at line 283 of file GridForceGrid.h.

Referenced by addToSubgridsFlat(), pack(), and unpack().


The documentation for this class was generated from the following files:
Generated on Sun Sep 24 01:17:18 2017 for NAMD by  doxygen 1.4.7