20#include "Vector/vector_dist_subset.hpp"
21#include "DCPSE/DCPSE_op/DCPSE_surface_op.hpp"
22#include "DCPSE/DCPSE_OP/DCPSE_Solver.hpp"
23#include "util/SphericalHarmonics.hpp"
32constexpr int NORMAL=4;
33constexpr int PCOORD=5;
39int main(
int argc,
char * argv[]) {
40 openfpm_init(&argc,&argv);
41 auto & v_cl = create_vcluster();
44 double grid_spacing_surf;
50 std::cout <<
"Error: The executable requires the following arguments: number_grid_points" << std::endl;
56 grid_spacing_surf=std::stof(argv[1]);
57 EIGENVAL=std::stof(argv[2]);
62 std::string cwd{boost::filesystem::current_path().string()};
63 std::string output_dir{cwd +
"/output_Bunny"};
65 p_output = output_dir +
"/particles";
66 double boxP1{-1.5}, boxP2{1.5};
67 double boxSize{boxP2 - boxP1};
68 rCut=2.5 * grid_spacing_surf;
70 Box<3,double> domain{{boxP1,boxP1,boxP1},{boxP2,boxP2,boxP2}};
71 size_t bc[3] = {NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
77 double Nx,Ny,Nz,Px,Py,Pz;
79 PCfile.open(
"data.csv");
82 while ( PCfile >> Nx >> Ny >> Nz >> Px >> Py >> Pz )
94 std::cout <<
"n: " << pctr <<
" - rCut: " << rCut <<
"nSpacing" << grid_spacing_surf<<std::endl;
102 auto &bulkIds=particles_bulk.getIds();
103 auto &bdrIds=particles_boundary.getIds();
111 SurfaceDerivative_x<NORMAL> Sdx{
particles,2,rCut,grid_spacing_surf};
112 SurfaceDerivative_y<NORMAL> Sdy{
particles,2,rCut,grid_spacing_surf};
113 SurfaceDerivative_z<NORMAL> Sdz{
particles,2,rCut,grid_spacing_surf};
115 SurfaceDerivative_xx<NORMAL> Sdxx{
particles,2,rCut,grid_spacing_surf};
116 SurfaceDerivative_yy<NORMAL> Sdyy{
particles,2,rCut,grid_spacing_surf};
117 SurfaceDerivative_zz<NORMAL> Sdzz{
particles,2,rCut,grid_spacing_surf};
119 DErr=-0.5*(Sdx(N[0])+Sdy(N[1])+Sdz(N[2]));
125 auto Eig = Sdxx(f)+Sdyy(f)+Sdzz(f)-EIGENVAL*f;
126 Solver.impose(Eig, bulkIds, 0);
127 Solver.impose(f, bdrIds, 0.1);
135 if (v_cl.rank() == 0)
136 std::cout <<
"Simulation took: " << tt.
getcputime() <<
" s (CPU) - " << tt.
getwct() <<
" s (wall)\n";
Header file containing functions for creating files and folders.
static void create_directory_if_not_exist(std::string path, bool silent=0)
Creates a directory if not already existent.
This class represent an N-dimensional box.
This class implement the point shape in an N-dimensional space.
Implementation of 1-D std::vector like structure.
Class for cpu time benchmarking.
void stop()
Stop the timer.
double getcputime()
Return the cpu time.
void start()
Start the timer.
double getwct()
Return the elapsed real time.
bool write_frame(std::string out, size_t iteration, int opt=VTK_WRITER)
Output particle position and properties.
auto getLastProp() -> decltype(v_prp.template get< id >(0))
Get the property of the last element.
void setPropNames(const openfpm::vector< std::string > &names)
Set the properties names.
void ghost_get(size_t opt=WITH_POSITION)
It synchronize the properties and position of the ghost particles.
void map(size_t opt=NONE)
It move all the particles that does not belong to the local processor to the respective processor.
bool write(std::string out, int opt=VTK_WRITER)
Output particle position and properties.
auto getLastPos() -> decltype(v_pos.template get< 0 >(0))
Get the position of the last element.
void add()
Add local particle.
void deleteGhost()
Delete the particles on the ghost.
[v_transform metafunction]
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...