Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
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
5 changes: 5 additions & 0 deletions lib/sapporo_light/sapporo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,8 @@ int sapporo::get_ngb_list(int cluster_id,
sort(nbl, nbl + min(nblen, maxlength));
return overflow;
}

int sapporo::get_nj_max() const
{
return nj_max;
}
14 changes: 13 additions & 1 deletion lib/sapporo_light/sapporo.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class sapporo {

predict = false;
nj_modified = 0;

device.address_j = NULL;

device.t_j = NULL;
Expand All @@ -182,8 +182,10 @@ class sapporo {
device.acc_i = NULL;
device.vel_i = NULL;
device.jrk_i = NULL;


};
int get_nj_max() const;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine, but maybe it belongs with get_n_pipes on line 191?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, you mean that would be a better place in terms of the program's logic?

~sapporo() {};

int open(int cluster_id);
Expand Down Expand Up @@ -230,3 +232,13 @@ class sapporo {
};

#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be above the #endif on 232, or things will go wrong when there's a header include loop. Maybe just add it on line 104 inside the existing extern "C" block there?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, will do.

#ifdef __cplusplus
extern "C" {
#endif

int g6_get_nj_max_();

#ifdef __cplusplus
}
#endif
6 changes: 6 additions & 0 deletions lib/sapporo_light/sapporoG6lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ extern "C" {

}

extern "C" {
int g6_get_nj_max_() {
return grav.get_nj_max();
}
}

7 changes: 7 additions & 0 deletions src/amuse_ph4/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -936,3 +936,10 @@ int get_id_of_updated_particle(int index, int * index_of_particle, int * status)
*status = jd->UpdatedParticles[index].status;
return 0;
}

extern "C" int g6_get_nj_max_();

int get_nj_max()
{
return g6_get_nj_max_();
}
4 changes: 4 additions & 0 deletions src/amuse_ph4/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ def recompute_timesteps():
function.result_type = 'int32'
return function

Comment thread
LourensVeen marked this conversation as resolved.
def get_nj_max():
function = LegacyFunctionSpecification()
function.result_type = 'int32'
return function

class ph4(GravitationalDynamics,GravityFieldCode):

Expand Down
Loading