优化端口传递物性参数方式,减少上下游元件重复计算量
This commit is contained in:
1 parent
91bd9fb252
commit
5d5a2e1843
12 files changed
+773
-65
No files matched your search
@@ -185,9 +185,9 @@ class EvaluationSchedule:
|
||||
closure; a pressure trial further restricts work to its residual inputs.
|
||||
"""
|
||||
helpers, lines = [], []
|
||||
args = 'p,h,g,w,q,fb,pipe_cache'
|
||||
args = 'p,h,g,w,q,fb,pipe_cache,properties'
|
||||
signature = ('double *p,double *h,const NativeGas *g,double *w,double *q,'
|
||||
'double *fb,NativePipeCache *pipe_cache')
|
||||
'double *fb,NativePipeCache *pipe_cache,NativePropertyCache *properties')
|
||||
|
||||
def code(indices):
|
||||
return [line for i in indices for line in
|
||||
@@ -195,7 +195,7 @@ class EvaluationSchedule:
|
||||
|
||||
def helper(name, indices):
|
||||
helpers.extend([f'static int {name}({signature}) {{',
|
||||
'(void)p;(void)h;(void)g;(void)w;(void)q;(void)fb;(void)pipe_cache;',
|
||||
'(void)p;(void)h;(void)g;(void)w;(void)q;(void)fb;(void)pipe_cache;(void)properties;',
|
||||
*code(indices), 'return 1;', '}'])
|
||||
return f'if(!{name}({args})) return 0;'
|
||||
|
||||
|
||||
Reference in new issue
Block a user