Skip to content

Commit

Permalink
Merge branch 'develop' into ccsepfix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhucaoxiang committed Apr 11, 2022
2 parents 6ec3c8c + ab106dc commit 17002e3
Show file tree
Hide file tree
Showing 7 changed files with 673 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install packages
run: |
sudo apt-get update
apt list --installed gfortran
echo $FC
sudo apt-get install gfortran
Expand Down
642 changes: 642 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# <img alt="FOCUS" src="https://princetonuniversity.github.io/FOCUS/logo.png" height="80"> Flexible Optimized Coils Using Space curves

**FOCUS** is a nonlinear optimization code for designing 3D coils.
**FOCUS** is a nonlinear optimization code for designing 3D coils.
Its sibling, **FAMUS**, can be use to design permanent magnets.

- **Website (including documentation):** https://princetonuniversity.github.io/FOCUS/
- **Source:** https://github.com/PrincetonUniversity/FOCUS
Expand All @@ -12,7 +13,6 @@

There are several branches available. Please use the correct one.

- **master:** the basic branch for the latest stable version.
- **develop:** the develop branch including the newest features.
- **dipole:** branch for designing permanent magnets (FAMUS).
- **old:** the old branch that was originally developped (require NAG library).
Expand Down
2 changes: 1 addition & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ More directions are referred to the official website.

# Compilation
To compile, use `make all`. Right now, I have only implemented `GCC` compiler.
Once compiled, you can test it by `make test`.

# Examples
A simple example can be found in ../examples/rotating_ellipse/test.py.
You can test it by `make test`.

# Usage
More documentation will be available in the future.
26 changes: 25 additions & 1 deletion python/focuspy.f90
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,28 @@ subroutine allocate_coils()
if ( ierr.ne.0 ) write(ounit, *) "Problems in allocating the array DoF, ierr=", ierr

return
end subroutine allocate_coils
end subroutine allocate_coils

subroutine get_coils(i, n, xx, yy, zz)
! access the data of the i-th coil
!
! import focus
! xx = np.zeros(focus.globals.nseg)
! yy = np.zeros(focus.globals.nseg)
! zz = np.zeros(focus.globals.nseg)
! focus.get_coils(1, focus.globals.nseg, xx, yy, zz)
!
use globals, only : dp, coil, ounit
implicit none

INTEGER,intent(in) :: i, n
REAL,intent(out) :: xx(n), yy(n), zz(n)

if (n .ne. (size(coil(i)%xx)-1)) write(ounit, *) "The size of array doesn't match.", n, size(coil(i)%xx)

xx = coil(i)%xx(0:n-1)
yy = coil(i)%yy(0:n-1)
zz = coil(i)%zz(0:n-1)

return
end subroutine get_coils
2 changes: 1 addition & 1 deletion sources/globals.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module globals

!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!

CHARACTER(10), parameter :: version='v0.14.06' ! version number
CHARACTER(10), parameter :: version='v0.15.00' ! version number

!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!

Expand Down
6 changes: 1 addition & 5 deletions sources/surface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SUBROUTINE surface
if ( weight_cssep > machprec ) then
plasma = 1
limiter = 2
if ( limiter_surf .eq. input_surf ) limiter = plasma ! use the plasma surface as limiter surface
else ! use the plasma surface as limiter
plasma = 1
limiter = 1
Expand All @@ -27,11 +28,6 @@ SUBROUTINE surface

! read the limiter surface
if (limiter /= plasma) then
if ( limiter_surf .eq. input_surf ) then
limiter = plasma
psurf = limiter
return
endif
inquire( file=trim(limiter_surf), exist=exist)
FATAL( surface, .not.exist, limiter_surf does not exist )
FATAL( surface, limiter <= plasma, something goes wrong the surface indexing )
Expand Down

0 comments on commit 17002e3

Please sign in to comment.