-
Notifications
You must be signed in to change notification settings - Fork 249
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
Libphantom-amuse #513
base: master
Are you sure you want to change the base?
Libphantom-amuse #513
Conversation
…phantom-amuse # Conflicts: # build/Makefile_setups
…om-amuse-upstreammerge
src/utils/libphantom-amuse.F90
Outdated
call set_io_unit_numbers() | ||
call initialise() | ||
call amuse_set_defaults() ! replaces reading infile | ||
call set_units(dist=1 * au,mass=1.*solarm,G=1.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one option here is to send strings for the units, then call select_unit(mass_unit,umass,ierr) to get the unit from the string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is inside setup/set_units.f90
|
||
end subroutine amuse_initialize_code_new | ||
|
||
subroutine amuse_initialize_code() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we delete this if obsolete?
!call amuse_initialize_wind() | ||
end subroutine amuse_initialize_code | ||
|
||
subroutine amuse_set_phantom_option(name, valstring, imatch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could in principle be done in a more automated way, if we were to read the infile like setup files... this is on my list (should create an issue on this to get this task done)
use deriv, only:derivs | ||
use part, only:npart,xyzh,vxyzu,fxyzu,fext,divcurlv,divcurlB,Bevol,dBevol,& | ||
dustprop,ddustprop,dustfrac,ddustevol,dens,drad,radprop,dustevol,& | ||
eos_vars,metrics,pxyzu,rad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just call get_derivs_global() here which calls derivs, then the interface to derivs would not need updating. This can be found in the derivs module and is used in the test suite
if (nodisabled) then | ||
npart_out = 0 | ||
do i=1,npart | ||
if (xyzh(4,i) > 0.) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition should be a call to isdead_or_accreted(xyzh(4,i)) for consistency with the other code
src/utils/libphantom-amuse.F90
Outdated
|
||
! This initialises things. This really should only be called once, before the first step. | ||
subroutine amuse_evol(amuse_initialise) | ||
use io, only:iprint,iwritein,id,master,iverbose,& |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed and replaced by a call to evol but with some flags needed for amuse to behave correctly
src/utils/libphantom-amuse.F90
Outdated
call kill_particle(i) | ||
else | ||
j = -i | ||
! Sink particles can't be killed - so we just set its mass to zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sink particles can be killed by giving them a negative mass, suggest xyzmh_ptmass(4,i) = -abs(xyzmh_ptmass(4,i))
endif | ||
end subroutine | ||
|
||
subroutine amuse_get_unit_length(unit_length_out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be a need for these routines, as long as set_units() is called during the amuse_initialize_code_new routine, and if you can send strings to set different options
dtextforce = 1.e-8 | ||
end subroutine | ||
|
||
subroutine amuse_evolve_model(tmax_in) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see previous, should be just a call to evolve
udist_out = udist | ||
end subroutine | ||
|
||
! End of Getters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete commented out/ obsolete code
- option not to write files - initialise only on the first call to evol
- create, use and update a map to the original particle ids to ensure AMUSE identifies the right particles
Type of PR:
new code: library for using Phantom with AMUSE
Description:
write_files
option, defaults to.true.
write_files
utils/libphantom-amuse.F90
, with helper subroutines for the AMUSE interfaceTesting:
WIP
Did you run the bots? yes/no
Did you update relevant documentation in the docs directory? yes/no