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

Fixing misc bugs #88

Merged
merged 7 commits into from
Nov 16, 2022
Merged
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
Merge branch 'develop' of github.com:PrincetonUniversity/FOCUS into s…
…tochastic
  • Loading branch information
zhucaoxiang committed Aug 31, 2022
commit 829b33d7cc30706429787410ae7523b35bfba614
148 changes: 148 additions & 0 deletions python/.ipynb_checkpoints/example-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# import necessary packages\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from mpi4py import MPI\n",
"from focuspy import FOCUS"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/Users/caoxiang/Documents/Codes/FOCUS/examples/rotating_ellipse\n"
]
}
],
"source": [
"cd ../examples/rotating_ellipse/"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# initialize\n",
"comm = MPI.COMM_WORLD\n",
"ext = 'ellipse'\n",
"ellipse = FOCUS(comm=comm, extension=ext, verbose=True)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# change variables and run \n",
"ellipse.globals.case_optimize = 0\n",
"ellipse.globals.case_postproc = 1\n",
"ellipse.run(verbose=True) \n",
"# screen output will apear if you don't use jupyter noteboook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can access all the variables in `globals`.\n",
"There is something wrong with allocatable arrays in a derived type, it will crash if you tried to check those variables like,\n",
"`ellipse.globals.coil[1].xx`\n",
"`ellipse.globals.surf[0].bn`."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.38178882123087676\n"
]
}
],
"source": [
"print(ellipse.globals.bnorm)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"4\n"
]
}
],
"source": [
"print(len(ellipse.globals.coil))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"b'Mod_002 '\n"
]
}
],
"source": [
"print(ellipse.globals.coil[1].name)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Empty file added python/tmp.focus_output
Empty file.
2 changes: 1 addition & 1 deletion sources/specinp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ SUBROUTINE specinp
do imn = 1, surf(isurf)%Nfou
write(wunit,1010) surf(isurf)%bin(imn)/Nfp_raw, surf(isurf)%bim(imn), surf(isurf)%Rbc(imn), &
surf(isurf)%bin(imn)/Nfp_raw, surf(isurf)%bim(imn), surf(isurf)%Zbs(imn), &
surf(isurf)%bin(imn/Nfp_raw), surf(isurf)%bim(imn), surf(isurf)%Rbs(imn), &
surf(isurf)%bin(imn)/Nfp_raw, surf(isurf)%bim(imn), surf(isurf)%Rbs(imn), &
surf(isurf)%bin(imn)/Nfp_raw, surf(isurf)%bim(imn), surf(isurf)%Zbc(imn) ! wall is read as plasma boundary
enddo
do imn = 1, Nbf
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.