20#include "Vector/vector_dist_subset.hpp"
21#include "Operators/Vector/vector_dist_operators.hpp"
22#include "DCPSE/DCPSE_op/DCPSE_surface_op.hpp"
23#include "DCPSE/DCPSE_op/DCPSE_Solver.hpp"
24#include "OdeIntegrators/OdeIntegrators.hpp"
34constexpr int NORMAL=4;
38double dt,tf,ALPHA=0.1;
45int main(
int argc,
char * argv[]) {
46 openfpm_init(&argc,&argv);
47 auto & v_cl = create_vcluster();
53 std::cout <<
"Warning: The executable requires the following arguments: number_grid_points FrequencyMode Order" << std::endl;
56 n = std::stoi(argv[1]);
57 k = std::stoi(argv[2]);
58 unsigned int ord = std::stoi(argv[3]);
61 std::string cwd{boost::filesystem::current_path().string()};
62 std::string output_dir{cwd +
"/output_circle_Poisson"};
64 p_output = output_dir +
"/particles";
67 double boxP1{-1.5}, boxP2{1.5};
68 double boxSize{boxP2 - boxP1};
70 double grid_spacing{boxSize/(sz[0]-1)};
71 double rCut{3.9 * grid_spacing};
74 size_t bc[2] = {NON_PERIODIC,NON_PERIODIC};
84 double dtheta{2*M_PI/double(n)};
85 if (v_cl.rank() == 0) {
86 for (
int i = 0; i < n; ++i) {
87 coord[0] = std::cos(theta);
88 coord[1] = std::sin(theta);
102 if(coord[0]==1. && coord[1]==0.)
106 std::cout <<
"n: " << n <<
" - grid spacing: " << grid_spacing <<
" - rCut: " << rCut <<
" - Dtheta: " << dtheta<<std::endl;
117 auto & bulk=particles_bulk.getIds();
118 auto & boundary=particles_boundary.getIds();
122 SurfaceDerivative_xx<NORMAL> Sdxx(
particles, ord, rCut,grid_spacing);
123 SurfaceDerivative_yy<NORMAL> Sdyy(
particles, ord, rCut,grid_spacing);
132 Solver.impose(Sdxx(f)+Sdyy(f), bulk, df);
133 Solver.impose(f, boundary, Af);
137 double MaxError=0,L2=0;
154 std::cout.precision(30);
156 std::cout<<
"dTheta:"<<dtheta<<std::endl;
157 std::cout<<
"L2:"<<L2<<std::endl;
158 std::cout<<
"L_inf:"<<MaxError<<std::endl;
166 if (v_cl.rank() == 0)
167 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.
vect_dist_key_dx get()
Get the actual key.
size_t size_local() const
return the local size of the vector
bool write_frame(std::string out, size_t iteration, int opt=VTK_WRITER)
Output particle position and properties.
auto getProp(vect_dist_key_dx vec_key) -> decltype(v_prp.template get< id >(vec_key.getKey()))
Get the property of an element.
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.
auto getPos(vect_dist_key_dx vec_key) -> decltype(v_pos.template get< 0 >(vec_key.getKey()))
Get the position of an element.
vector_dist_iterator getDomainIterator() const
Get an iterator that traverse the particles in the domain.
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...
Specify the general characteristic of system to solve.