1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
S_A_V [24]
2 years ago
6

Lammps ERROR on proc 0: Out of range atoms - cannot compute PPPM

SAT
1 answer:
Alexeev081 [22]2 years ago
6 0

Using the knowledge in computational language in C++ it is possible to write a code that Out of range atoms:

<h3>Writting the code in C++:</h3>

<em>#include <cmath></em>

<em>#include "pppm_tip4p.h"</em>

<em>#include "atom.h"</em>

<em>#include "domain.h"</em>

<em>#include "force.h"</em>

<em>#include "memory.h"</em>

<em>#include "error.h"</em>

<em>#include "math_const.h"</em>

<em />

<em>using namespace LAMMPS_NS;</em>

<em>using namespace MathConst;</em>

<em />

<em>#define OFFSET 16384</em>

<em />

<em>#ifdef FFT_SINGLE</em>

<em>#define ZEROF 0.0f</em>

<em>#define ONEF  1.0f</em>

<em>#else</em>

<em>#define ZEROF 0.0</em>

<em>#define ONEF  1.0</em>

<em>#endif</em>

<em />

<em>void PPPMTIP4P::init()</em>

<em>{</em>

<em>  // TIP4P PPPM requires newton on, b/c it computes forces on ghost atoms</em>

<em />

<em>  if (force->newton == 0)</em>

<em>    error->all(FLERR,"Kspace style pppm/tip4p requires newton on");</em>

<em />

<em>  PPPM::init();</em>

<em>}</em>

<em />

<em>void PPPMTIP4P::particle_map()</em>

<em>{</em>

<em>  int nx,ny,nz,iH1,iH2;</em>

<em>  double *xi,xM[3];</em>

<em />

<em>  int *type = atom->type;</em>

<em>  double **x = atom->x;</em>

<em>  int nlocal = atom->nlocal;</em>

<em />

<em>  if (!std::isfinite(boxlo[0]) || !std::isfinite(boxlo[1]) || !std::isfinite(boxlo[2]))</em>

<em>    error->one(FLERR,"Non-numeric box dimensions - simulation unstable");</em>

<em />

<em>  int flag = 0;</em>

<em>  for (int i = 0; i < nlocal; i++) {</em>

<em>    if (type[i] == typeO) {</em>

<em>      find_M(i,iH1,iH2,xM);</em>

<em>      xi = xM;</em>

<em>    } else xi = x[i];</em>

<em />

<em>    nx = static_cast<int> ((xi[0]-boxlo[0])*delxinv+shift) - OFFSET;</em>

<em>    ny = static_cast<int> ((xi[1]-boxlo[1])*delyinv+shift) - OFFSET;</em>

<em>    nz = static_cast<int> ((xi[2]-boxlo[2])*delzinv+shift) - OFFSET;</em>

<em />

<em>    part2grid[i][0] = nx;</em>

<em>    part2grid[i][1] = ny;</em>

<em>    part2grid[i][2] = nz;</em>

<em />

<em>    if (nx+nlower < nxlo_out || nx+nupper > nxhi_out ||</em>

<em>        ny+nlower < nylo_out || ny+nupper > nyhi_out ||</em>

<em>        nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag++;</em>

<em>  }</em>

<em />

<em>  int flag_all;</em>

<em>  MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);</em>

<em>  if (flag_all) error->all(FLERR,"Out of range atoms - cannot compute PPPM");</em>

<em>}</em>

<em>void PPPMTIP4P::make_rho()</em>

<em>{</em>

<em>  int i,l,m,n,nx,ny,nz,mx,my,mz,iH1,iH2;</em>

<em>  FFT_SCALAR dx,dy,dz,x0,y0,z0;</em>

<em>  double *xi,xM[3];</em>

<em />

<em>  FFT_SCALAR *vec = &density_brick[nzlo_out][nylo_out][nxlo_out];</em>

<em>  for (i = 0; i < ngrid; i++) vec[i] = ZEROF;</em>

<em />

<em>  int *type = atom->type;</em>

<em>  double *q = atom->q;</em>

<em>  double **x = atom->x;</em>

<em>  int nlocal = atom->nlocal;</em>

<em />

<em>  for (int i = 0; i < nlocal; i++) {</em>

<em>    if (type[i] == typeO) {</em>

<em>      find_M(i,iH1,iH2,xM);</em>

<em>      xi = xM;</em>

<em>    } else xi = x[i];</em>

<em />

<em>    nx = part2grid[i][0];</em>

<em>    ny = part2grid[i][1];</em>

<em>    nz = part2grid[i][2];</em>

<em>    dx = nx+shiftone - (xi[0]-boxlo[0])*delxinv;</em>

<em>    dy = ny+shiftone - (xi[1]-boxlo[1])*delyinv;</em>

<em>    dz = nz+shiftone - (xi[2]-boxlo[2])*delzinv;</em>

<em />

<em>    compute_rho1d(dx,dy,dz);</em>

<em />

<em>    z0 = delvolinv * q[i];</em>

<em>    for (n = nlower; n <= nupper; n++) {</em>

<em>      mz = n+nz;</em>

<em>      y0 = z0*rho1d[2][n];</em>

<em>      for (m = nlower; m <= nupper; m++) {</em>

<em>        my = m+ny;</em>

<em>        x0 = y0*rho1d[1][m];</em>

<em>        for (l = nlower; l <= nupper; l++) {</em>

<em>          mx = l+nx;</em>

<em>          density_brick[mz][my][mx] += x0*rho1d[0][l];</em>

<em>        }</em>

<em>      }</em>

<em>    }</em>

<em>  }</em>

<em>}</em>

See more about C++ at brainly.com/question/19705654

#SPJ1

You might be interested in
Oh ee oh ah ah ting tang walla walla bing bang. points to whoever figures out what sing this is.
IceJOKER [234]

Answer:

Witch Doctor

Song by Ross Bagdasarian Sr.

Explanation:

I instantly thought of Alvin and the Chipmunks!

5 0
3 years ago
Read 2 more answers
What can we do when we are bored?​
Svetradugi [14.3K]
  • Listen to songs
  • Read a book
  • Dance
  • C.h.a.t with friends
  • Watch television
  • Painting
  • Anything of your interest (◕ᴗ◕✿)
7 0
3 years ago
Read 2 more answers
the captain has a probability 3/7 of hitting the pirate ship. the pirate only has one good eye, so he hits the captains ship wit
Dmitry_Shevchenko [17]

Answer:

9/35

Explanation:

6 0
4 years ago
Which element below is least reactive? Which element below must be stored in oil because of its reactivity?
olganol [36]

Answer:

What are the elements to be stored?

4 0
3 years ago
Four ways in which you can address the identified socio economic factors.
iVinArrow [24]

Answer:

Increase communication frequency and accessibility. For those coming from different backgrounds than the typical American, communication is critical. ...

Develop on-going, automated recall programs. ...

Use multiple contact channels. ...

Be flexible on your no-show policies

3 0
2 years ago
Other questions:
  • Hatred stirs up conflict, but love covers over all wrongs. Proverbs 10:12. what does this bible verse mean?​
    11·1 answer
  • Which type of cell has a large, central vacuole that controls water pressure?
    13·2 answers
  • Shawn received the following scores on his ACT Test: Math 30 Reading 25 Science 27 English 27 and a 7 on the writing test. What
    11·2 answers
  • Two types of student loans are _____.
    15·2 answers
  • I'm looking into colleges. Does anyone know of any good premed colleges?
    7·2 answers
  • A parish or borough is also known as a government. county. municipality. town.
    8·1 answer
  • the differences between the use of aversive stimulation in sibis vs the use of aversive stimulation at the rotenberg center is t
    15·1 answer
  • Once alcohol has passed into the large intestine it is.
    15·2 answers
  • In a normal distribution, the number of organisms exhibiting a phenotype variant near the lowest value is(1 point).
    12·1 answer
  • Aron is building a website that will require a back-end database. He plans to connect the web server on his network in a way tha
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!