3 import java.lang.reflect.InvocationTargetException;
4 import java.lang.reflect.Method;
18 private Class<?> affineFunctionsClass;
19 private Object affineFunctionsInstance;
28 affineFunctionsClass = theclass;
29 affineFunctionsInstance = inst;
41 boolean noQ_uLdefined =
false;
45 meth = affineFunctionsClass.getMethod(
"get_n_uL_functions", (Class<?>[]) null);
46 }
catch (NoSuchMethodException nsme) {
59 Object Q_uL_obj = meth.invoke(affineFunctionsInstance, (Object[]) null);
60 Q_uL = (Integer) Q_uL_obj;
61 }
catch (IllegalAccessException iae) {
62 throw new RuntimeException(iae);
63 }
catch (InvocationTargetException ite) {
64 throw new RuntimeException(ite.getCause());
66 return Q_uL.intValue();
75 public double thetaQm(
int i,
double[] p,
double t) {
82 Class<?> partypes[] =
new Class[2];
83 partypes[0] = Integer.TYPE;
84 partypes[1] =
double[].class;
86 meth = affineFunctionsClass.getMethod(
"evaluateM", partypes);
87 }
catch (NoSuchMethodException nsme) {
88 throw new RuntimeException(
"getMethod for evaluateM failed", nsme);
93 Object arglist[] =
new Object[2];
94 arglist[0] =
new Integer(i);
97 Object theta_obj = meth.invoke(affineFunctionsInstance, arglist);
98 theta_val = (Double) theta_obj;
99 }
catch (IllegalAccessException iae) {
100 throw new RuntimeException(iae);
101 }
catch (InvocationTargetException ite) {
102 throw new RuntimeException(ite.getCause());
105 return theta_val.doubleValue();
117 meth = affineFunctionsClass.getMethod(
"get_n_M_functions", (Class<?>[]) null);
118 }
catch (NoSuchMethodException nsme) {
119 throw new RuntimeException(
"getMethod for get_n_M_functions failed", nsme);
122 Object Q_m_obj = meth.invoke(affineFunctionsInstance, (Object[]) null);
123 return (Integer) Q_m_obj;
124 }
catch (IllegalAccessException iae) {
125 throw new RuntimeException(iae);
126 }
catch (InvocationTargetException ite) {
127 throw new RuntimeException(ite.getCause());
156 Class<?> partypes[] =
new Class[1];
157 partypes[0] = Integer.TYPE;
158 meth = affineFunctionsClass.getMethod(
"get_Q_l", partypes);
160 int[] Ql_values =
new int[no];
161 Object arglist[] =
new Object[1];
162 for (
int i = 0; i < no; i++) {
164 Ql_values[i] = (Integer) meth.invoke(affineFunctionsInstance, arglist);
167 }
catch (NoSuchMethodException nsme) {
168 throw new RuntimeException(
"getMethod failed: " + nsme.getMessage(), nsme);
169 }
catch (IllegalAccessException iae) {
170 throw new RuntimeException(iae);
171 }
catch (InvocationTargetException ite) {
172 throw new RuntimeException(ite.getCause());
180 public double thetaQl(
int i,
int q_l,
double[] p,
double t) {
187 Class<?> partypes[] =
new Class[3];
188 partypes[0] = Integer.TYPE;
189 partypes[1] = Integer.TYPE;
190 partypes[2] =
double[].class;
192 meth = affineFunctionsClass.getMethod(
"evaluateL", partypes);
193 }
catch (NoSuchMethodException nsme) {
194 throw new RuntimeException(
"getMethod for evaluateL failed", nsme);
199 Object arglist[] =
new Object[3];
200 arglist[0] =
new Integer(i);
201 arglist[1] =
new Integer(q_l);
204 Object theta_obj = meth.invoke(affineFunctionsInstance, arglist);
205 theta_val = (Double) theta_obj;
206 }
catch (IllegalAccessException iae) {
207 throw new RuntimeException(iae);
208 }
catch (InvocationTargetException ite) {
209 throw new RuntimeException(ite.getCause());
212 return theta_val.doubleValue();
221 Method meth = affineFunctionsClass.getMethod(
"get_n_F_functions", (Class<?>[]) null);
222 return (Integer) meth.invoke(affineFunctionsInstance, (Object[]) null);
223 }
catch (NoSuchMethodException nsme) {
224 throw new RuntimeException(
"getMethod failed: " + nsme.getMessage(), nsme);
225 }
catch (IllegalAccessException iae) {
226 throw new RuntimeException(iae);
227 }
catch (InvocationTargetException ite) {
228 throw new RuntimeException(ite.getCause());
236 public double thetaQf(
int i,
double[] p,
double t) {
243 Class<?> partypes[] =
new Class[2];
244 partypes[0] = Integer.TYPE;
245 partypes[1] =
double[].class;
247 meth = affineFunctionsClass.getMethod(
"evaluateF", partypes);
248 }
catch (NoSuchMethodException nsme) {
249 throw new RuntimeException(
"getMethod for evaluateF failed", nsme);
254 Object arglist[] =
new Object[2];
258 Object theta_obj = meth.invoke(affineFunctionsInstance, arglist);
259 theta_val = (Double) theta_obj;
260 }
catch (IllegalAccessException iae) {
261 throw new RuntimeException(iae);
262 }
catch (InvocationTargetException ite) {
263 throw new RuntimeException(ite.getCause());
266 return theta_val.doubleValue();
279 meth = affineFunctionsClass.getMethod(
"get_n_A_functions", (Class<?>[]) null);
280 }
catch (NoSuchMethodException nsme) {
281 throw new RuntimeException(
"getMethod for get_n_A_functions failed", nsme);
286 Object Q_a_obj = meth.invoke(affineFunctionsInstance, (Object[]) null);
287 Q_a = (Integer) Q_a_obj;
288 }
catch (IllegalAccessException iae) {
289 throw new RuntimeException(iae);
290 }
catch (InvocationTargetException ite) {
291 throw new RuntimeException(ite.getCause());
294 return Q_a.intValue();
301 public double thetaQa(
int i,
double[] p,
double t) {
308 Class<?> partypes[] =
new Class[2];
309 partypes[0] = Integer.TYPE;
310 partypes[1] =
double[].class;
312 meth = affineFunctionsClass.getMethod(
"evaluateA", partypes);
313 }
catch (NoSuchMethodException nsme) {
314 throw new RuntimeException(
"getMethod for evaluateA failed", nsme);
319 Object arglist[] =
new Object[2];
323 Object theta_obj = meth.invoke(affineFunctionsInstance, arglist);
324 theta_val = (Double) theta_obj;
325 }
catch (IllegalAccessException iae) {
326 throw new RuntimeException(iae);
327 }
catch (InvocationTargetException ite) {
328 throw new RuntimeException(ite.getCause());
331 return theta_val.doubleValue();
342 Method meth = affineFunctionsClass.getMethod(
"get_n_outputs", (Class<?>[]) null);
343 Object n_outputs_obj = meth.invoke(affineFunctionsInstance, (Object[]) null);
344 Integer n_outputs = (Integer) n_outputs_obj;
345 return n_outputs.intValue();
346 }
catch (NoSuchMethodException nsme) {
347 throw new RuntimeException(
"getMethod failed: " + nsme.getMessage(), nsme);
348 }
catch (IllegalAccessException iae) {
349 throw new RuntimeException(iae);
350 }
catch (InvocationTargetException ite) {
351 throw new RuntimeException(ite.getCause());
Interface for models using the mQ_uL fields.
Compatibility class for old rbAppMIT affine functions.
Interface for AffineFunctions in unsteady rb systems.
double thetaQl(int i, int q_l, double[] p, double t)
Base interface for any affine functions used as an externally loaded class.
double thetaQf(int i, double[] p, double t)
boolean isTimeDependentL()
boolean isTimeDependentA()
rbappmitAffineFunctions(Class<?> theclass, Object inst)
Creates a wrapper for the old rbAppMIT affine functions classes.
boolean isTimeDependentM()
double thetaQm(int i, double[] p, double t)
double thetaQa(int i, double[] p, double t)