1 package models.rbm_advec_cheatbase;
24 private double dirichletBoundCoeffs(
int i,
double[] p,
double t) {
31 double h3 = h * h * h;
33 double b1 = (6 * x0 - 3 * h) / h3;
34 double c1 = (6 * x0 * x0 - 6 * x0 * h) / -h3;
35 double d1 = 1 + (-2 * x0 * x0 * x0 + 3 * x0 * x0 * h) / -h3;
37 double b2 = (6 * x0 + 3 * h) / -h3;
38 double c2 = (6 * x0 * x0 + 6 * x0 * h) / h3;
39 double d2 = (2 * x0 * x0 * x0 + 3 * x0 * x0 * h - h3) / -h3;
42 double S1 = a1 * x * x * x + b1 * x * x + c1 * x + d1;
43 double S2 = a2 * x * x * x + b2 * x * x + c2 * x + d2;
45 if ((x0 - h <= x) && (x < x0))
47 if ((x0 <= x) && (x <= x0 + h))
59 for (
int i = 1; i < p.length; i++) {
94 return new int[] { 1 };
140 public double thetaQa(
int i,
double[] p,
double t) {
141 if ((i < 0) || (i >
getQa() - 1)) {
142 throw new RuntimeException(
"Input parameter is invalid in thetaQa()," +
" i = " + i +
" but getQa() = "
145 return p[i + 1] * (1 - t);
152 public double thetaQf(
int i,
double[] p,
double t) {
153 if ((i < 0) || (i >
getQf() - 1)) {
154 throw new RuntimeException(
"Input parameter is invalid in evaluateF()," +
" i = " + i
155 +
" but get_n_F_functions() = " +
getQf());
176 int didx = (int) Math.floor(i /
getQa());
177 int Qaidx = i -
getQa() * didx;
178 return thetaQa(Qaidx, p, t) * dirichletBoundCoeffs(didx, p, t);
185 public double thetaQl(
int k,
int i,
double[] p,
double t) {
186 if ((k < 0) || (k >
getQl().length - 1)) {
187 throw new RuntimeException(
"Input parameter is invalid in evaluateL()," +
" k = " + k
188 +
" but get_n_outputs() = " +
getQl());
191 if ((i < 0) || (i >
getQl()[i] - 1)) {
192 throw new RuntimeException(
"Input parameter is invalid in evaluateL()," +
" q_l = " + i
193 +
" but get_Q_l(i) = " +
getQl()[i]);
203 public double thetaQm(
int i,
double[] p,
double t) {
212 return dirichletBoundCoeffs(i, p, 0);
boolean isTimeDependentL()
double thetaQl(int k, int i, double[] p, double t)
Interface for AffineFunctions in unsteady rb systems.
double thetaQf(int i, double[] p, double t)
double thetaQa(int i, double[] p, double t)
Base interface for any affine functions used as an externally loaded class.
boolean isTimeDependentA()
boolean isTimeDependentM()
Interface for affinely decomposed initial value conditions.
double thetaQm(int i, double[] p, double t)
double get_SCM_LB(double[] p)
double thetaQu0(int i, double[] p)
Affine coefficient functions for time-dependent advection/diffusion problem.