~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to lib/atc/LammpsInterface.h

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#include <iostream>
8
8
#include <string>
9
9
#include <sstream>
 
10
#include <fstream>
10
11
#include <utility>
11
12
#include "mpi.h"
12
 
#include "lammps.h"
13
 
#include "modify.h"
14
 
#include "memory.h"
15
 
#include "random_park.h"
 
13
#include "../../src/lmptype.h"
 
14
#include "../../src/lammps.h"
 
15
#include "../../src/comm.h"
 
16
#include "../../src/modify.h"
 
17
#include "../../src/memory.h"
 
18
#include "../../src/random_park.h"
16
19
typedef LAMMPS_NS::RanPark* RNG_POINTER;
17
 
#include "lmptype.h"
18
 
#include "compute.h"
 
20
#include "../../src/compute.h"
19
21
typedef const LAMMPS_NS::Compute* COMPUTE_POINTER;
20
 
#include "update.h"
21
 
#include "min.h"
 
22
#include "../../src/update.h"
 
23
#include "../../src/min.h"
22
24
#include "ATC_Error.h"
23
25
#include "ATC_TypeDefs.h"
24
26
#include "MatrixDef.h"
91
93
    SI
92
94
  };
93
95
 
 
96
  // Enumeration for atom data style
 
97
  enum AtomStyle {
 
98
    UNKNOWN_STYLE=0,
 
99
    ATOMIC_STYLE,
 
100
    CHARGE_STYLE,
 
101
    FULL_STYLE
 
102
  };
 
103
 
94
104
  // Provides a struct for easily passing/recovering data about SparseMats
95
105
  struct SparseMatInfo { 
96
106
    INDEX rows;
212
222
    MPI_Wrappers::send(lammps_->world, send_buf, send_size);
213
223
  }
214
224
  void allgatherv(double * send_buf, int send_count,
215
 
               double * rec_buf, int * rec_counts, int * displacements) const
 
225
                  double * rec_buf, int * rec_counts, int * displacements) const
216
226
  {
217
227
    MPI_Wrappers::allgatherv(lammps_->world, send_buf, send_count, rec_buf,
218
228
                             rec_counts, displacements);
219
229
  }
 
230
  void int_allgather(int send, int* recv)
 
231
  {
 
232
    MPI_Wrappers::int_allgather(lammps_->world,send,recv);
 
233
  }
220
234
  void int_scatter(int * send_buf, int * rec_buf, int count = 1)
221
235
  {
222
236
    MPI_Wrappers::int_scatter(lammps_->world, send_buf, rec_buf, count);
233
247
  {
234
248
    MPI_Wrappers::stop(lammps_->world, msg);
235
249
  }
 
250
  std::string read_file(std::string filename) const;
 
251
  void write_file(std::string filename, std::string contents, 
 
252
     std::ofstream::openmode mode = std::ofstream::out) const {
 
253
     if (! comm_rank()) {
 
254
       std::ofstream f(filename.c_str(),mode);
 
255
       f << contents;
 
256
       f.close();
 
257
     } 
 
258
     // ignore other ranks and assume they are consistent
 
259
  }
236
260
// end MPI --------------------------------------------------------------------
237
261
 
238
262
  void print_debug(std::string msg="") const