Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do not merge yet] Add 'Mizuki', an SPH/Nbody code based on FDPS #942

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move remaining files
  • Loading branch information
rieder committed Mar 10, 2022
commit 981bb644ee2f700c07ea69d149fe14dbb9fe8874
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ endif

CPPOBJS = $(patsubst %.cpp, %.o, $(wildcard *.cpp))
CPPHDRS = $(wildcard *.h)
PROGRAM = sui.out
PROGRAM = mizuki.out

.PHONY: clean all

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
#include "mathematical_constants.h"
#include "physical_constants.h"
#include "user_defined.hpp"
#include "sui.hpp"
#include "mizuki.hpp"

static Sui* sui=NULL;
static Mizuki* mizuki=NULL;

int main(int argc, char* argv[]){
// Initialize FDPS
sui = new Sui;
mizuki = new Mizuki;
PS::S64 id;
PS::F64 mass;
PS::F64 x;
Expand All @@ -39,8 +39,8 @@ int main(int argc, char* argv[]){
PS::F64 vz;
PS::F64 eng;

sui->initialize(argc, argv);
sui->set_defaults();
mizuki->initialize(argc, argv);
mizuki->set_defaults();

// Populate SPH with AMUSE here
PS::S32 N_sph = 10000;
Expand All @@ -53,25 +53,25 @@ int main(int argc, char* argv[]){
vy = 0.;
vz = 0.;
eng = 100.;
sui->add_hydro_particle(
mizuki->add_hydro_particle(
i, mass, x, y, z, vx, vy, vz, eng
);
}
PS::F64vec pos = sui->get_position(50);
PS::F64vec pos = mizuki->get_position(50);
x = pos.x;
y = pos.y;
z = pos.z;
std::cout << id << " " << x << " " << y << " " << z << std::endl;

// Commit particles
sui->commit_particles();
mizuki->commit_particles();

std::cout << "There are " << sui->get_number_of_particles_sph()
std::cout << "There are " << mizuki->get_number_of_particles_sph()
<< " particles!" << std::endl;

// Finalize FDPS
sui->finalize();
delete sui;
sui = NULL;
mizuki->finalize();
delete mizuki;
mizuki = NULL;
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ void setPressure(PS::ParticleSystem<FP_sph>& psys){
}


class Sui {
class Mizuki {
private:
PS::S64 nstep;
PS::F64 time;
PS::S64 id_offset;
PS::S64 N_sph_max;
PS::F32 theta_gravity;
Expand All @@ -91,9 +90,10 @@ class Sui {
public:
PS::ParticleSystem<FP_nbody> psys_nbody;
PS::ParticleSystem<FP_sph> psys_sph;
PS::F64 time;
PS::F64 epsilon_gravity;
PS::F64 dt_max;
Sui() {
Mizuki() {
this->boundary_condition = PS::BOUNDARY_CONDITION_OPEN;
this->nstep = 0;
this->time = 0.;
Expand Down