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
On a straight horizontal track along which blocks can slide with negligible friction, block 1 slides toward block 2, which is in
kiruha [24]

The additional measurements which must be made to determine the momentum of block 2 after the collision is both the mass and the post-collision speed of block 1

<h3>What is momentum?</h3>

Momentum can be defined as a scalar quantity that involves the multiplication of the mass of an object by its velocity.

In Physics, the momentum of an object such as a block, is calculated by using this formula;

Momentum = mass × velocity

In conclusion, we can deduce that the additional measurements which must be made to determine the momentum of block 2 after the collision is both the mass and the post-collision speed of block 1.

Read more on momentum here: brainly.com/question/15517471

#SPJ1

5 0
3 years ago
How do stars recycle and process matter in the universe?
pickupchik [31]

In a cyclic universe, new matter and energy are created about every trillion years when two sheet-like "branes" collide along an extra dimension of space. Branes are predicted by string theory. ... Once the universe is emptied out, a weak attractive force brings our universe's two branes together in a cosmic collision.
4 0
4 years ago
Read 2 more answers
The connotative meaning of a word
zimovet [89]

Answer:

thesaurus............

3 0
3 years ago
Read 2 more answers
1. What is the difference between a learner’s license and a driver’s license?
weeeeeb [17]

ur learning license shows that u r a beginner and not an experienced driver.

8 0
3 years ago
Which of the following involves a change in the physical properties only?
Alex777 [14]
Mixing an acid and a base
7 0
3 years ago
Other questions:
  • Hello, there has been a scammer that has been bugging me and I was just wondering if any of you guys/girls can bug him back his
    14·1 answer
  • Which term refers to a universal fact sometimes based on mathematical equation ? Hypothesis, prediction, scientific inquiry, or
    15·2 answers
  • Which planets are the OUTER planets? Where did they form in the nebula disk? Why did they form where they did? (discuss temperat
    5·1 answer
  • Marco's study suggested that elementary students who watch TV more than three hours a day are more likely to be overweight than
    12·1 answer
  • Alright everyone. I have to take the PSAT and I'm a bit nervous. I'm not even supposed to take them in the eight grade so I'm ev
    12·2 answers
  • What is the probability of Susan turning 45 years old given that she Has just turned 44
    9·1 answer
  • A force of 30 n stretches a very light ideal spring 0. 73 m from equilibrium. What is the force constant (spring constant) of th
    9·1 answer
  • How would an audio recording of this excerpt help establish the setting of the play? through an increase in volume at certain po
    7·1 answer
  • 18. refers a story or an account of something, dealing with sequences of events an experiences, though not necessarily in strict
    14·1 answer
  • Which of the following is true about an intrusion detection system
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!