Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/amuse/community/seba/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def new_option_parser():
result = OptionParser()
result.add_option(
"--seba-version",
default='74a4a649db0b52a9de51d54ddd7350ba98438fa4',
default='5257018d9fd90500c03b165ef130e6fe6344b320',
dest="seba_version",
help="SeBa commit hash to download",
type="string"
Expand Down
12 changes: 10 additions & 2 deletions src/amuse/community/seba/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,14 @@ int get_gyration_radius(int index_of_the_star, double * gyration_radius){
return error_code;
}

int get_apsidal_motion_constant(int index_of_the_star, double * apsidal_motion_constant){
int error_code = 0;
node * seba_node = get_seba_node_from_index(index_of_the_star, &error_code);
if(error_code < 0) {return error_code;}
*apsidal_motion_constant = seba_node->get_starbase()->amc();
return error_code;
}

int get_rotation_period(int index_of_the_star, double * rotation_period){
int error_code = 0;
node * seba_node = get_seba_node_from_index(index_of_the_star, &error_code);
Expand All @@ -632,11 +640,11 @@ int get_rotation_period(int index_of_the_star, double * rotation_period){
return error_code;
}

int get_fallback(int index_of_the_star, double * rotation_period){
int get_fallback(int index_of_the_star, double * fallback){
int error_code = 0;
node * seba_node = get_seba_node_from_index(index_of_the_star, &error_code);
if(error_code < 0) {return error_code;}
*rotation_period = seba_node->get_starbase()->get_fallback();
*fallback = seba_node->get_starbase()->get_fallback();
return error_code;
}

Expand Down
29 changes: 28 additions & 1 deletion src/amuse/community/seba/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,33 @@ def get_gyration_radius():
function.result_type = 'int32'
function.result_doc = """
0 - OK
Current value of the gyration radius was retrieved
Current value of the gyration radius was retrieved
-1 - ERROR
The code does not have support for retrieving the gyration radius
"""
return function

@legacy_function
def get_apsidal_motion_constant():
"""
Retrieve the current value of the apsidal motion constant (no units).
"""
function = LegacyFunctionSpecification()
function.can_handle_array = True
function.addParameter('index_of_the_star', dtype='int32', direction=function.IN
, description="The index of the star to set the value of")
function.addParameter('apsidal_motion_constant', dtype='float64', direction=function.OUT,
description = "The current value of the apsidal motion constant")
function.result_type = 'int32'
function.result_doc = """
0 - OK
Current value of the apsidal motion constant was retrieved
-1 - ERROR
The code does not have support for retrieving the apsidal motion constant
"""
return function


@legacy_function
def get_rotation_period():
"""
Expand Down Expand Up @@ -906,6 +927,11 @@ def define_methods(self, handler):
(handler.INDEX,),
(units.none, handler.ERROR_CODE,)
)
handler.add_method(
"get_apsidal_motion_constant",
(handler.INDEX,),
(units.none, handler.ERROR_CODE,)
)
handler.add_method(
"get_rotation_period",
(handler.INDEX,),
Expand Down Expand Up @@ -1015,6 +1041,7 @@ def define_particle_sets(self, handler):
handler.add_getter('particles', 'get_convective_envelope_mass', names = ('convective_envelope_mass',))
handler.add_getter('particles', 'get_convective_envelope_radius', names = ('convective_envelope_radius',))
handler.add_getter('particles', 'get_gyration_radius', names = ('gyration_radius',))
handler.add_getter('particles', 'get_apsidal_motion_constant', names = ('apsidal_motion_constant',))
handler.add_getter('particles', 'get_rotation_period', names = ('rotation_period',))
handler.add_setter('particles', 'set_rotation_period', names = ('rotation_period',))
handler.add_getter('particles', 'get_fallback', names = ('fallback',))
Expand Down