当前位置: 首页>>代码示例>>C++>>正文


C++ AtomList::get方法代码示例

本文整理汇总了C++中AtomList::get方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomList::get方法的具体用法?C++ AtomList::get怎么用?C++ AtomList::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AtomList的用法示例。


在下文中一共展示了AtomList::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: qbboundary

//
// qbboundary - set the elements on the boundary
//
double GeometricFlow::qbboundary( double x, double y, double z,
      const AtomList& atomList )
{  
   double vbdn = 0;
   for (size_t a = 0; a < atomList.size(); ++a) {
      //
      // vector from the current point (x_{g}) to the atom
      // (x_{i}}
      //
      double x_q = x - atomList.get(a).x(); //xyzr[a][1];
      double y_q = y - atomList.get(a).y(); //xyzr[a][2];
      double z_q = z - atomList.get(a).z(); //xyzr[a][3];
      //std::cout << "atomList: " 
      //   << atomList.get(a).x() << ", " 
      //   << atomList.get(a).y() << ", " 
      //   << atomList.get(a).z() << endl; 
      //std::cout << "x_q,y_q,z_q: " << x_q << ", " 
      //   << y_q << ", " << z_q << std::endl;
      double q_q = atomList.get(a).pqr(); //pqr[a];
      //std::cout << "q_q: " << q_q << std::endl;
      // distance, | x_{g} - x_{i} |
      double rr = sqrt( dot(x_q, y_q, z_q) );  // distance from
      vbdn += q_q/( m_sdie * rr );
      //std::cout << "m_sdie: " << m_sdie << std::endl;
   }
   return vbdn;
}
开发者ID:Electrostatics,项目名称:geoflow_c,代码行数:30,代码来源:GeometricFlow.cpp

示例2: reconec

void MoleculaB::reconec (double param)
{			//IGUAL QUE PONCONEC; pero sin iniciar --> JUST AS PONCONEC; but without initiating
    int nv = susatomos.size ();
    for (int i = 0; i < nv; i++) {
    Atomo *atm = susatomos.get(i);
    atm->index = i;
    }
    for (int i = 0; i < nv; i++) {
    Atomo *atm = susatomos.get (i);
    pto3D ptoa = atm->vert;
    int tipA = atm->tipo;

    AtomList alst = susatomos.neighborhood(atm);
    for (int j = 0; j < alst.size(); j++) {
        Atomo *atm2 = alst.get(j);
        pto3D ptob = atm2->vert;
        int tipB = atm2->tipo;
        double distamax = param * (periodicTable()->en1[tipA] +
                       periodicTable()->en1[tipB]);	//PARAMETRO AQUI
        if (ptoa.dista (ptob) < distamax && ptoa.dista (ptob) > 0.6)
        conecta (i, atm2->index);
    }
    }
    //depuraconec();                          //OJO!!!
}
开发者ID:elfion,项目名称:nanoengineer,代码行数:25,代码来源:MoleculaB.cpp

示例3: domainInitialization

//
//  Set up the grid - create a bounding box around the atoms, padded by
//  p_extvalue.
//
void GeometricFlow::domainInitialization( const AtomList& atomList )
{
   unsigned int natm = atomList.size();
    std::valarray<double> atom_x(natm), 
                          atom_y(natm),
                          atom_z(natm), 
                          atom_r(natm);

    for(size_t i = 0; i < natm; ++i) 
   {
        atom_x[i] = atomList.get(i).x(); 
        atom_y[i] = atomList.get(i).y(); 
        atom_z[i] = atomList.get(i).z(); 
        atom_r[i] = atomList.get(i).r(); 
    }

    double xleft = left(atom_x - atom_r, p_comdata.deltax(), p_extvalue);
    double yleft = left(atom_y - atom_r, p_comdata.deltay(), p_extvalue);
    double zleft = left(atom_z - atom_r, p_comdata.deltaz(), p_extvalue);

    double xright = right(atom_x + atom_r, p_comdata.deltax(), p_extvalue);
    double yright = right(atom_y + atom_r, p_comdata.deltay(), p_extvalue);
    double zright = right(atom_z + atom_r, p_comdata.deltaz(), p_extvalue);

    int nx = (xright - xleft)/p_comdata.deltax() + 1;
    int ny = (yright - yleft)/p_comdata.deltay() + 1;
    int nz = (zright - zleft)/p_comdata.deltaz() + 1;

    xright = xleft + p_comdata.deltax()*(nx - 1);
    yright = yleft + p_comdata.deltay()*(ny - 1);
    zright = zleft + p_comdata.deltaz()*(nz - 1);

    //keep this around for later
   p_comdata.setBounds( xleft, xright, 
                        yleft, yright,
                        zleft, zright,
                        nx, ny, nz );

}
开发者ID:Electrostatics,项目名称:geoflow_c,代码行数:43,代码来源:GeometricFlow.cpp

示例4: ponconec

void MoleculaB::ponconec (double param)  // ponconec --> put connected??
{
    int nv = susatomos.size ();
    for (int i = 0; i < nv; i++) {
    Atomo *atm = susatomos.get(i);
    atm->index = i;
    }
    for (int i = 0; i < nv; i++) {
    Atomo *atm = susatomos.get(i);
    pto3D ptoa = atm->vert;
    int tipA = atm->tipo;

    //reiniciamos el array de conectividad
    // we reinitiated the connectivity Array
    int *mc = new int[10];
    mc[0] = 0;	//un array para cada atomo i
            // an Array for each atom i
    for (int j = 1; j <= 9; j++)
        mc[j] = 0;

    AtomList alst = susatomos.neighborhood(atm);
    for (int j = 0; j < alst.size(); j++) {
        Atomo *atm2 = alst.get(j);
        pto3D ptob = atm2->vert;
        int tipB = atm2->tipo;
        double distamax = param * (periodicTable()->en1[tipA] +
                       periodicTable()->en1[tipB]);	//PARAMETRO AQUI
        if (ptoa.dista (ptob) < distamax && ptoa.dista (ptob) > 0.6) {
        int k = mc[0] + 1;
        mc[0] = k;
        mc[k] = atm2->index;
        }
    }

    //y lo ponemos como un todo El array es mejor manejarlo como un todo, incluso seria
    //conveniente para girarlo, poder sacar y meter un vert[] solo de puntos, en funcion de su efectividad
    // and we put it as a whole the Array is better to handle it like a whole, serious even advisable to
    // turn it, to be able to remove and to put vert [] single of points, based on its effectiveness
    susatomos.get(i)->mconec = mc;
    }
    // depura --> it purifies
    depuraconec ();	//OJO!!!
}
开发者ID:elfion,项目名称:nanoengineer,代码行数:43,代码来源:MoleculaB.cpp

示例5: yhsurface

//
//		yhsurface
//
void GeometricFlow::yhsurface( const AtomList& atomList,
        double tott, double dt, Mat<>& phitotx, Mat<>& surfu, int iloop,
        double& area, double& volume, double& attint, double alpha, int iadi,
        int igfin, double roro, double conms )
{
   const int natm = atomList.size();
    size_t nx = p_comdata.nx(), ny = p_comdata.ny(), nz = p_comdata.nz();
    double xl = p_comdata.xleft(), yl = p_comdata.yleft(), zl = p_comdata.zleft();
    std::valarray<double> atom_x(natm), atom_y(natm), atom_z(natm), atom_r(natm);
    for (size_t i = 0; i < natm; ++i) {
        atom_x[i] = atomList.get(i).x();
        atom_y[i] = atomList.get(i).y();
        atom_z[i] = atomList.get(i).z();
        atom_r[i] = atomList.get(i).r();
    }

    Mat<> su(surfu), g(surfu);
    initial(xl, yl, zl, natm, atom_x,atom_y, atom_z, atom_r, g, su);
    if (iloop > 1 && igfin == 1)
        su = surfu;
   //cout << "test2: " ; su.print(); cout << endl ;
   //cout << "test2: " ; g.print(); cout << endl ;

    double rcfactor = (p_ffmodel == 1) ? 1.0 : pow(2.0, 1.0/6.0);
    std::valarray<double> sigma(atom_r);
    std::valarray<double> seta12(natm), seta6(natm), epsilon(natm);

    if (p_ffmodel == 1) {
        for (size_t i = 0; i < natm; ++i) {
            sigma[i] = atom_r[i] + p_sigmas;
            if (m_vdwdispersion != 0) {
                double se = sigma[i]/(atom_r[i] + p_prob);
                epsilon[i] = pow( pow(se, 12.0) - 2.0*pow(se, 6.0) , -1.0);
            }
            seta12[i] = p_lj_iosetar * m_vdwdispersion * epsilon[i];
            seta6[i] = 2.0*p_lj_iosetaa * m_vdwdispersion * epsilon[i];
        }
    } else {
        for (size_t i = 0; i < natm; ++i) {
            sigma[i] = sqrt(4.0* atom_r[i] * p_sigmas);
            if (m_vdwdispersion != 0) {
                epsilon[i] = sqrt(atomList.get(i).epsilon() * p_epsilonw);
                seta12[i] = 4.0*epsilon[i];
                seta6[i] = 4.0*epsilon[i];
            }
        }
    }

    Mat<> potr(nx,ny,nz), pota(nx,ny,nz);
    potIntegral(rcfactor, natm, atom_x, atom_y, atom_z, seta12, seta6,
            epsilon, sigma, g, potr, pota);

    if (p_lj_iwca == 1)
        potr = 0;

   //cout << conms << " " << roro << endl ;
    for (size_t i = 0; i < phitotx.size(); ++i) {
        phitotx[i] = -conms - phitotx[i] + roro*(potr[i] + pota[i]);
    }
   //cout << "test2: " ; phitotx.print(); cout << endl ;

    if (iadi == 0 || iloop > 1) {
        int nt = ceil(tott/dt) + 1;
        upwinding(dt, nt, g, su, phitotx);
    } else {
        std::cerr << "ADI not implemented..." << std::endl;
        exit(1);
    }
   //cout << "test2: " ; su.print(); cout << endl ;

    if (iloop > 1) {
        for (size_t i = 0; i < surfu.size(); ++i) {
           surfu[i] = surfu[i]*alpha + su[i]*(1.0 - alpha);
        }
        su = surfu;
    } else {
        surfu = su;
    }

//   cout << "alpha: " << alpha << endl;
//   cout << "test2: " ; su.print(); cout << endl ;

    volume = volumeIntegration(su);
    std::cout << "volume = " << volume << std::endl;

    Mat<> fintegr(nx,ny,nz);
    double dx = p_comdata.deltax(), dy = p_comdata.deltay(), dz = p_comdata.deltaz();
    for (size_t x = 2; x < nx; ++x) {
        for (size_t y = 2; y < ny; ++y) {
            for (size_t z = 2; z < nz; ++z) {
                double sux = su(x+1,y,z) - su(x-1,y,z);
                double suy = su(x,y+1,z) - su(x,y-1,z);
                double suz = su(x,y,z+1) - su(x,y,z-1);
                fintegr(x,y,z) = sqrt( dot(sux/(2.0*dx), suy/(2.0*dy), suz/(2.0*dz)));
            }
        }
    }
//.........这里部分代码省略.........
开发者ID:Electrostatics,项目名称:geoflow_c,代码行数:101,代码来源:GeometricFlow.cpp


注:本文中的AtomList::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。