Python wrapper for running instances of trisurf-ng
Samo Penic
2018-07-05 99c340cc251a82abda5b38bd185bbf97a9f4251d
Changed wrapper
1 files modified
67 ■■■■■ changed files
trisurf/wrapper.py 67 ●●●●● patch | view | raw | blame | history
trisurf/wrapper.py
@@ -82,10 +82,11 @@
        ('znorm', c_double),
        ('area', c_double),
        ('volume', c_double),
        ('energy', c_double),
    ]
class ts_triangle_list(Structure):
    _fields_=[('n',c_uint),('tria', POINTER(POINTER(ts_triangle)))]
    _fields_=[('n',c_uint),('a0',c_double),('tria', POINTER(POINTER(ts_triangle))),]
ts_cell._fields_=[
@@ -145,6 +146,8 @@
        ('pswitch',c_long),
        ('constvolswitch',c_long),
        ('constareaswitch',c_long),
        ('stretchswitch',c_long),
        ('xkA0',c_double),
        ('constvolprecision',c_double),
        ('multiprocessing',c_char_p),
        ('brezveze0',c_long),
@@ -199,7 +202,7 @@
ts_cluster._fields_=[('nvtx',c_uint),('idx',c_uint),('vtx', POINTER(POINTER(ts_vertex)))]
class ts_cluster_list(Structure):
    _fields_=[('n',c_uint),('poly',POINTER(POINTER(ts_cluster)))]
    _fields_=[('n',c_uint),('cluster',POINTER(POINTER(ts_cluster)))]
@@ -247,5 +250,65 @@
    ts.vesicle_free.argtype=[POINTER(ts_vesicle)]
    ts.vesicle_free(vesicle)
def vesicle_volume(vesicle):
    ts.vesicle_volume.argtype=[POINTER(ts_vesicle)]
    ts.vesicle_volume(vesicle)
def vesicle_area(vesicle):
    ts.vesicle_area.argtype=[POINTER(ts_vesicle)]
    ts.vesicle_area(vesicle)
def gyration_eigen(vesicle):
    ts.gyration_eigen.argtype=[POINTER(ts_vesicle), POINTER(c_double), POINTER(c_double), POINTER(c_double)]
    l1=c_double(0.0)
    l2=c_double(0.0)
    l3=c_double(0.0)
    ts.gyration_eigen(vesicle , byref(l1), byref(l2), byref(l3))
    return (l1.value, l2.value, l3.value)
def vesicle_meancurvature(vesicle):
    ts.vesicle_meancurvature.argtype=[POINTER(ts_vesicle)]
    ts.vesicle_meancurvature.restype=c_double
    return ts.vesicle_meancurvature(vesicle)
def init_cluster_list():
    ts.init_cluster_list.restype=POINTER(ts_cluster_list)
    ret=ts.init_cluster_list()
    return ret
def clusterize_vesicle(vesicle, cluster_list):
    ts.clusterize_vesicle.argtype=[POINTER(ts_vesicle), POINTER(ts_cluster_list)]
    ts.clusterize_vesicle(vesicle, cluster_list)
def cluster_list_free(cluster_list):
    """Free memory of cluster list"""
    ts.cluster_list_free.argtype=[POINTER(ts_cluster_list)]
    ts.cluster_list_free(cluster_list)
def stretchenergy(vesicle, triangle):
    ts.stretchenergy.argtype=[POINTER(ts_vesicle), POINTER(ts_triangle)]
    ts.stretchenergy(vesicle,triangle)
def get_absolute_ulm2(vesicle,l,m):
    ts.get_absolute_ulm2.argtype=[POINTER(ts_vesicle), c_double, c_double]
    ts.get_absolute_ulm2.restype=c_double
    ret=ts.get_absolute_ulm2(vesicle,l,m)
    return ret
def getR0(vesicle):
    ts.getR0.argtype=[POINTER(ts_vesicle)]
    ts.getR0.restype=c_double
    r0=ts.getR0(vesicle)
    return r0
def preparationSh(vesicle,r0):
    ts.preparationSh.argtype=[POINTER(ts_vesicle), c_double]
    ts.preparationSh(vesicle,float(r0))
def calculateUlmComplex(vesicle):
    ts.calculateUlmComplex.argtype=[POINTER(ts_vesicle)]
    ts.calculateUlmComplex(vesicle)
def solve_for_ulm2(vesicle):
    ts.solve_for_ulm2.argtype=[POINTER(ts_vesicle)]
    ts.solve_for_ulm2(vesicle)