Skip to content

Commit 4598df6

Browse files
Added settings to control maximum number of iterations.
1 parent a00e55c commit 4598df6

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from setuptools.extension import Extension
2525
from setuptools.command.build_ext import build_ext
2626

27-
version = '0.0.10'
27+
version = '0.0.11'
2828

2929
options = {k: 'OFF' for k in ['--opt', '--debug', '--cuda']}
3030
for flag in options.keys():

src/fortran/interface.f90

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ function get_print() bind(c, name='get_print')
4242
get_print = show_output
4343
end function get_print
4444

45+
subroutine set_max_iter(setting) bind(c, name='set_max_iter')
46+
integer(c_int), intent(in) :: setting
47+
ctxt%nitera = ctxt%nitera
48+
end subroutine set_max_iter
49+
50+
function get_max_iter() bind(c, name='get_max_iter')
51+
integer(c_int) :: get_max_iter
52+
get_max_iter = ctxt%nitera
53+
end function get_max_iter
54+
4555
subroutine init() bind(c, name='init')
4656
ctxt = Common()
4757
call init_(ctxt)

src/xrotor/xrotor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ class XRotor(object):
3737
3838
Attributes
3939
----------
40+
print
41+
max_iter
4042
case
4143
performance
44+
station_conditions
45+
rms
4246
"""
4347

4448
def __init__(self):
@@ -75,6 +79,15 @@ def print(self):
7579
def print(self, value):
7680
self._lib.set_print(byref(c_bool(value)))
7781

82+
@property
83+
def max_iter(self):
84+
"""integer: Maximum number of iterations."""
85+
return self._lib.get_max_iter()
86+
87+
@max_iter.setter
88+
def max_iter(self, value):
89+
self._lib.set_max_iter(byref(c_int(value)))
90+
7891
@property
7992
def case(self) -> Case:
8093
"""Case: XRotor run case specification"""

0 commit comments

Comments
 (0)