11 import java.io.BufferedReader;
12 import java.io.IOException;
14 import org.apache.commons.math.linear.Array2DRowRealMatrix;
15 import org.apache.commons.math.linear.ArrayRealVector;
16 import org.apache.commons.math.linear.LUDecompositionImpl;
17 import org.apache.commons.math.linear.RealMatrix;
18 import org.apache.commons.math.linear.RealVector;
35 private static final String DEBUG_TAG =
"TransientRBSystem";
40 private boolean apply_temporal_filter_flag;
42 private double[][][][] Aq_Mq_representor_norms;
44 private double[][] cached_Aq_Aq_matrix;
46 private double[][] cached_Aq_Mq_matrix;
48 private double[] cached_Fq_Aq_vector;
49 private double[] cached_Fq_Mq_vector;
50 private double cached_Fq_term;
52 private double[][] cached_Mq_Mq_matrix;
65 private double euler_theta;
69 private double filter_width;
73 private double[][][] Fq_Mq_representor_norms;
85 private double[][][] Mq_Mq_representor_norms;
129 boolean tdL = affineFunctionsInstance.isTimeDependentL();
130 double output_dual_norm = 0;
142 double conv_weight_integral_sq = 0.;
143 RB_convolved_outputs_all_k[n][time_level] = 0.;
146 double time_diff =
getdt() * (time_level - k_prime);
147 RB_convolved_outputs_all_k[n][time_level] +=
getdt() *
conv_weight(time_diff)
154 * output_dual_norm * Math.sqrt(conv_weight_integral_sq);
169 for (
int q_f1 = 0; q_f1 <
getQf(); q_f1++) {
171 double cached_theta_q_f1 =
thetaQf(q_f1);
172 for (
int q_f2 = q_f1; q_f2 <
getQf(); q_f2++) {
173 double delta = (q_f1 == q_f2) ? 1. : 2.;
180 for (
int q_f = 0; q_f <
getQf(); q_f++) {
181 double cached_theta_q_f =
thetaQf(q_f);
182 for (
int q_a = 0; q_a <
getQa(); q_a++) {
183 double cached_theta_q_a =
thetaQa(q_a);
184 for (
int i = 0; i < N; i++) {
186 if ((q_f == 0) && (q_a == 0))
187 cached_Fq_Aq_vector[i] = 0.;
189 cached_Fq_Aq_vector[i] += 2. * cached_theta_q_f * cached_theta_q_a
196 for (
int q_a1 = 0; q_a1 <
getQa(); q_a1++) {
197 double cached_theta_q_a1 =
thetaQa(q_a1);
198 for (
int q_a2 = q_a1; q_a2 <
getQa(); q_a2++) {
199 double cached_theta_q_a2 =
thetaQa(q_a2);
200 double delta = (q_a1 == q_a2) ? 1. : 2.;
202 for (
int i = 0; i < N; i++) {
203 for (
int j = 0; j < N; j++) {
206 cached_Aq_Aq_matrix[i][j] = 0.;
208 cached_Aq_Aq_matrix[i][j] += delta * cached_theta_q_a1 * cached_theta_q_a2
216 for (
int q_f = 0; q_f <
getQf(); q_f++) {
217 double cached_theta_q_f =
thetaQf(q_f);
219 for (
int q_m = 0; q_m <
getQm(); q_m++) {
220 double cached_theta_q_m =
thetaQm(q_m);
222 for (
int i = 0; i < N; i++) {
224 if ((q_f == 0) && (q_m == 0))
225 cached_Fq_Mq_vector[i] = 0.;
227 cached_Fq_Mq_vector[i] += 2. * cached_theta_q_f * cached_theta_q_m
228 * Fq_Mq_representor_norms[q_f][q_m][i];
233 for (
int q_a = 0; q_a <
getQa(); q_a++) {
234 double cached_theta_q_a =
thetaQa(q_a);
236 for (
int q_m = 0; q_m <
getQm(); q_m++) {
237 double cached_theta_q_m =
thetaQm(q_m);
239 for (
int i = 0; i < N; i++) {
240 for (
int j = 0; j < N; j++) {
242 if ((q_a == 0) && (q_m == 0))
243 cached_Aq_Mq_matrix[i][j] = 0.;
245 cached_Aq_Mq_matrix[i][j] += 2. * cached_theta_q_a * cached_theta_q_m
246 * Aq_Mq_representor_norms[q_a][q_m][i][j];
253 for (
int q_m1 = 0; q_m1 <
getQm(); q_m1++) {
254 double cached_theta_q_m1 =
thetaQm(q_m1);
255 for (
int q_m2 = q_m1; q_m2 <
getQm(); q_m2++) {
256 double cached_theta_q_m2 =
thetaQm(q_m2);
257 double delta = (q_m1 == q_m2) ? 1. : 2.;
259 for (
int i = 0; i < N; i++) {
260 for (
int j = 0; j < N; j++) {
262 cached_Mq_Mq_matrix[i][j] = 0.;
264 cached_Mq_Mq_matrix[i][j] += delta * cached_theta_q_m1 * cached_theta_q_m2
265 * Mq_Mq_representor_norms[q][i][j];
287 RealVector RB_u_euler_theta = RB_solution.mapMultiply(
getEulerTheta()).add(
291 double residual_norm_sq = cached_Fq_term;
293 for (
int i = 0; i < N; i++) {
294 residual_norm_sq += RB_u_euler_theta.getEntry(i) * cached_Fq_Aq_vector[i];
295 residual_norm_sq += mass_coeffs.getEntry(i) * cached_Fq_Mq_vector[i];
298 for (
int i = 0; i < N; i++)
299 for (
int j = 0; j < N; j++) {
300 residual_norm_sq += RB_u_euler_theta.getEntry(i) * RB_u_euler_theta.getEntry(j)
301 * cached_Aq_Aq_matrix[i][j];
302 residual_norm_sq += mass_coeffs.getEntry(i) * mass_coeffs.getEntry(j) * cached_Mq_Mq_matrix[i][j];
303 residual_norm_sq += RB_u_euler_theta.getEntry(i) * mass_coeffs.getEntry(j) * cached_Aq_Mq_matrix[i][j];
306 if (residual_norm_sq < 0) {
307 Log.d(DEBUG_TAG,
"Warning: Square of residual norm is negative "
308 +
"in TransientRBSystem::compute_residual_dual_norm()");
313 residual_norm_sq = Math.abs(residual_norm_sq);
316 return Math.sqrt(residual_norm_sq);
322 double sigma = filter_width *
getdt();
324 return 1. / Math.sqrt(2. * Math.PI * sigma * sigma) * Math.exp(-x * x / (2. * sigma * sigma));
363 res.addTransform(dt);
368 throw new RuntimeException(
"Too many output fields used by current "
369 +
"SolutionFieldTypes set in RBSystem. Check your model.xml.");
371 switch (sftype.Type) {
378 for (
int dim = 0; dim < numDoFs; dim++) {
380 for (
int j = 0; j < N; j++) {
383 f.setValue((
timestep - 1) * numDoFs + dim, (
float) tmpval);
390 throw new RuntimeException(
"Invalid/unimplemented solution field type '" + sftype.Type
391 +
"' for transient RB system");
397 curDoFfield += sftype.Type.requiredDoFFields;
421 nt = nt > 25 ? 25 : nt;
430 super.initialize_data_vectors();
448 super.loadOfflineData_rbappmit(m);
451 cached_Fq_Aq_vector =
new double[
getNBF()];
453 cached_Fq_Mq_vector =
new double[
getNBF()];
458 BufferedReader reader = m.getBufReader(
"RB_L2_matrix.dat");
460 String[] tokens = reader.readLine().split(
" ");
467 for (
int i = 0; i <
getNBF(); i++)
468 for (
int j = 0; j <
getNBF(); j++) {
469 RB_L2_matrix.setEntry(i, j, Double.parseDouble(tokens[count]));
475 Log.d(DEBUG_TAG,
"Finished reading RB_L2_matrix.dat");
481 for (
int q_m = 0; q_m <
getQm(); q_m++) {
483 BufferedReader reader = m.getBufReader(
"RB_M_" + String.format(
"%03d", q_m) +
".dat");
485 String line = reader.readLine();
488 String[] tokens = line.split(
" ");
495 for (
int i = 0; i <
getNBF(); i++)
496 for (
int j = 0; j <
getNBF(); j++) {
497 RB_M_q_matrix[q_m].setEntry(i, j, Double.parseDouble(tokens[count]));
501 Log.d(DEBUG_TAG,
"Finished reading RB_M_q data");
506 BufferedReader reader = m.getBufReader(
"Fq_Mq_norms.dat");
508 String line = reader.readLine();
511 String[] tokens = line.split(
" ");
518 for (
int q_f = 0; q_f <
getQf(); q_f++)
519 for (
int q_m = 0; q_m <
getQm(); q_m++)
520 for (
int i = 0; i <
getNBF(); i++) {
521 Fq_Mq_representor_norms[q_f][q_m][i] = Double.parseDouble(tokens[count]);
525 Log.d(DEBUG_TAG,
"Finished reading Fq_Mq_norms.dat");
530 BufferedReader reader = m.getBufReader(
"Mq_Mq_norms.dat");
532 String line = reader.readLine();
535 String[] tokens = line.split(
" ");
539 Mq_Mq_representor_norms =
new double[Q_m_hat][
getNBF()][
getNBF()];
543 for (
int q = 0; q < Q_m_hat; q++)
544 for (
int i = 0; i <
getNBF(); i++)
545 for (
int j = 0; j <
getNBF(); j++) {
546 Mq_Mq_representor_norms[q][i][j] = Double.parseDouble(tokens[count]);
549 Log.d(DEBUG_TAG,
"Finished reading Mq_Mq_norms.dat");
555 BufferedReader reader = m.getBufReader(
"Aq_Mq_norms.dat");
557 String line = reader.readLine();
560 String[] tokens = line.split(
" ");
567 for (
int q_a = 0; q_a <
getQa(); q_a++)
568 for (
int q_m = 0; q_m <
getQm(); q_m++)
569 for (
int i = 0; i <
getNBF(); i++)
570 for (
int j = 0; j <
getNBF(); j++) {
571 Aq_Mq_representor_norms[q_a][q_m][i][j] = Double.parseDouble(tokens[count]);
575 }
catch (IOException iae) {
581 for (
int i = 0; i <
getQa(); i++)
582 for (
int j = 0; j <
getQm(); j++) {
583 String file =
"Aq_Mq_" + String.format(
"%03d", i) +
"_" + String.format(
"%03d", j)
585 Aq_Mq_representor_norms[i][j] = mr.readRawDoubleMatrix(m.getInStream(file),
getNBF(),
getNBF());
596 Log.d(DEBUG_TAG,
"Finished reading Aq_Mq_norms.dat");
605 super.loadOfflineDataJRB(m);
608 cached_Fq_Aq_vector =
new double[
getNBF()];
610 cached_Fq_Mq_vector =
new double[
getNBF()];
618 RB_L2_matrix = mr.readMatrix(m.getInStream(
"RB_L2_matrix.bin"));
625 for (
int q_m = 0; q_m < fQm; q_m++) {
626 filename =
"RB_M_" + String.format(
"%03d", q_m) +
".bin";
629 Log.d(DEBUG_TAG,
"Finished reading RB_M_q data");
635 Fq_Mq_representor_norms =
new double[
getQf()][fQm][];
636 for (
int q_f = 0; q_f <
getQf(); q_f++) {
637 for (
int q_m = 0; q_m < fQm; q_m++) {
638 filename =
"Fq_Mq_" + String.format(
"%03d", q_f) +
"_" + String.format(
"%03d", q_m) +
".bin";
639 Fq_Mq_representor_norms[q_f][q_m] = mr.readRawDoubleVector(m.getInStream(filename));
642 Log.d(DEBUG_TAG,
"Finished reading Fq_Mq_norms.dat");
647 int Q_m_hat = fQm * (fQm + 1) / 2;
648 Mq_Mq_representor_norms =
new double[Q_m_hat][][];
649 for (
int q1 = 0; q1 < fQm; q1++) {
650 for (
int q2 = 0; q2 < fQm - q1; q2++) {
651 filename =
"Mq_Mq_" + String.format(
"%03d", q1) +
"_" + String.format(
"%03d", q2) +
".bin";
652 Mq_Mq_representor_norms[q2 + q1 * fQm] = mr.readRawDoubleMatrix(m.getInStream(filename));
655 Log.d(DEBUG_TAG,
"Finished reading Mq_Mq_norms.dat");
660 Aq_Mq_representor_norms =
new double[
getQa()][fQm][][];
661 for (
int i = 0; i <
getQa(); i++) {
662 for (
int j = 0; j < fQm; j++) {
663 filename =
"Aq_Mq_" + String.format(
"%03d", i) +
"_" + String.format(
"%03d", j) +
"_norms.bin";
664 Aq_Mq_representor_norms[i][j] = mr.readRawDoubleMatrix(m.getInStream(filename));
667 Log.d(DEBUG_TAG,
"Finished reading Aq_Mq_norms.dat");
679 throw new RuntimeException(
"ERROR: N cannot be larger than the number " +
"of basis functions in RB_solve");
682 throw new RuntimeException(
"ERROR: N must be greater than 0 in RB_solve");
685 RealMatrix RB_mass_matrix_N = null;
686 RealMatrix RB_LHS_matrix = null;
687 RealMatrix RB_RHS_matrix = null;
692 boolean tdA = affineFunctionsInstance.isTimeDependentA() || tdM;
694 boolean LHSMatrixIsID =
false;
701 RB_mass_matrix_N =
new Array2DRowRealMatrix(N, N);
702 for (
int q_m = 0; q_m <
getQm(); q_m++) {
703 RB_mass_matrix_N = RB_mass_matrix_N.add(
RB_M_q_matrix[q_m].getSubMatrix(0, N - 1, 0, N - 1)
704 .scalarMultiply(
thetaQm(q_m)));
709 RB_LHS_matrix = RB_mass_matrix_N;
710 RB_RHS_matrix = RB_mass_matrix_N;
719 for (
int q_a = 0; q_a <
getQa(); q_a++) {
720 RB_LHS_matrix = RB_LHS_matrix.add(
RB_A_q_vector[q_a].getSubMatrix(0, N - 1, 0, N - 1).scalarMultiply(
722 RB_RHS_matrix = RB_RHS_matrix.add(
RB_A_q_vector[q_a].getSubMatrix(0, N - 1, 0, N - 1).scalarMultiply(
725 LHSMatrixIsID = isIdentityMatrix(RB_LHS_matrix);
732 RealVector RB_solution_N = RB_solution.copy();
733 RealVector old_RB_solution_N = RB_solution_N.copy();
736 RealVector RB_rhs_N =
new ArrayRealVector(N);
741 double error_bound_sum = 0.;
750 for (
int q_l = 0; q_l <
getQl(k); q_l++) {
765 for (
int time_level = 1; time_level <=
fTotalTimesteps; time_level++) {
767 double t =
getdt() * (time_level - 1);
775 RB_mass_matrix_N =
new Array2DRowRealMatrix(N, N);
776 for (
int q_m = 0; q_m <
getQm(); q_m++) {
777 RB_mass_matrix_N = RB_mass_matrix_N.add(
RB_M_q_matrix[q_m].getSubMatrix(0, N - 1, 0, N - 1)
778 .scalarMultiply(
thetaQm(q_m, t)));
783 RB_LHS_matrix = RB_mass_matrix_N;
784 RB_RHS_matrix = RB_mass_matrix_N;
785 for (
int q_a = 0; q_a <
getQa(); q_a++) {
786 RB_LHS_matrix = RB_LHS_matrix.add(
RB_A_q_vector[q_a].getSubMatrix(0, N - 1, 0, N - 1)
788 RB_RHS_matrix = RB_RHS_matrix.add(
RB_A_q_vector[q_a].getSubMatrix(0, N - 1, 0, N - 1)
791 LHSMatrixIsID = isIdentityMatrix(RB_LHS_matrix);
796 old_RB_solution_N = RB_solution_N;
799 RB_rhs_N = RB_RHS_matrix.operate(old_RB_solution_N);
802 RealVector force =
new ArrayRealVector(N);
803 for (
int q_f = 0; q_f <
getQf(); q_f++) {
806 RB_rhs_N = RB_rhs_N.add(force.mapMultiplyToSelf(
getdt()));
808 if (!LHSMatrixIsID) {
810 RB_solution_N =
new LUDecompositionImpl(RB_LHS_matrix).getSolver().solve(RB_rhs_N);
812 RB_solution_N = RB_rhs_N;
815 double[] sol = RB_solution_N.getData();
816 String sol_str =
"[";
817 for (
int i = 0; i < sol.length; i++) {
818 sol_str += String.format(
"%1.15e ", sol[i]);
840 for (
int q_l = 0; q_l <
getQl(i); q_l++) {
860 RealMatrix RB_L2_matrix_N = RB_L2_matrix.getSubMatrix(0, N - 1, 0, N - 1);
861 double final_RB_L2_norm = Math.sqrt(RB_L2_matrix_N.operate(RB_solution_N).dotProduct(RB_solution_N));
863 if (apply_temporal_filter_flag) {
871 private boolean isIdentityMatrix(RealMatrix m) {
874 for (
int i = 0; i < m.getRowDimension(); i++) {
875 for (
int j = 0; j < m.getColumnDimension(); j++) {
876 if ((i == j && m.getEntry(i, j) != 1) || (i != j && m.getEntry(i, j) != 0))
885 super.readConfigurationJRB(m);
887 dt = Double.parseDouble(m.getModelXMLTagValue(
"rb_model.timeinfo.dt"));
888 euler_theta = Double.parseDouble(m.getModelXMLTagValue(
"rb_model.timeinfo.euler_theta"));
889 fTotalTimesteps = Integer.parseInt(m.getModelXMLTagValue(
"rb_model.timeinfo.K"));
892 .parseInt(m.getModelXMLTagValue(
"model.visual.plotSteps",
"" + (
fTotalTimesteps + 1)));
901 super.readConfigurationRBAppMIT(infile);
903 dt = infile.call(
"dt", 0.);
905 euler_theta = infile.call(
"euler_theta", 1.);
907 int apply_temporal_filter_flag_in = infile.call(
"apply_temporal_filter_flag", 0);
908 apply_temporal_filter_flag = (apply_temporal_filter_flag_in != 0);
910 double filter_width_in = infile.call(
"filter_width", 2.);
911 filter_width = filter_width_in;
913 int n_plotting_steps_in = infile.call(
"n_plotting_steps",
getTotalTimesteps() + 1);
916 Log.d(DEBUG_TAG,
"TransientRBSystem parameters from " + Const.parameters_filename +
":");
917 Log.d(DEBUG_TAG,
"dt: " +
getdt());
919 Log.d(DEBUG_TAG,
"euler_theta (for generalized Euler): " +
getEulerTheta());
920 Log.d(DEBUG_TAG,
"Apply a temporal filter? " + apply_temporal_filter_flag);
921 if (apply_temporal_filter_flag) {
922 Log.d(DEBUG_TAG,
"Temporal filter std. dev. " + filter_width);
927 Log.d(DEBUG_TAG,
"Q_m = " + fQm);
950 this.timestep = k_in;
999 RealVector RB_u_euler_theta = RB_solution.mapMultiply(
getEulerTheta()).add(
1003 double residual_norm_sq = 0.;
1006 for (
int q_f1 = 0; q_f1 <
getQf(); q_f1++) {
1007 double cached_theta_q_f1 =
thetaQf(q_f1);
1008 for (
int q_f2 = q_f1; q_f2 <
getQf(); q_f2++) {
1009 double delta = (q_f1 == q_f2) ? 1. : 2.;
1016 for (
int q_f = 0; q_f <
getQf(); q_f++) {
1017 double cached_theta_q_f =
thetaQf(q_f);
1018 for (
int q_a = 0; q_a <
getQa(); q_a++) {
1019 double cached_theta_q_a =
thetaQa(q_a);
1020 for (
int i = 0; i < N; i++) {
1021 residual_norm_sq += 2. * RB_u_euler_theta.getEntry(i) * cached_theta_q_f * cached_theta_q_a
1028 for (
int q_a1 = 0; q_a1 <
getQa(); q_a1++) {
1029 double cached_theta_q_a1 =
thetaQa(q_a1);
1030 for (
int q_a2 = q_a1; q_a2 <
getQa(); q_a2++) {
1031 double cached_theta_q_a2 =
thetaQa(q_a2);
1032 double delta = (q_a1 == q_a2) ? 1. : 2.;
1034 for (
int i = 0; i < N; i++) {
1035 for (
int j = 0; j < N; j++) {
1036 residual_norm_sq += delta * RB_u_euler_theta.getEntry(i) * RB_u_euler_theta.getEntry(j)
1046 for (
int q_m1 = 0; q_m1 <
getQm(); q_m1++) {
1047 double cached_theta_q_m1 =
thetaQm(q_m1);
1048 for (
int q_m2 = q_m1; q_m2 <
getQm(); q_m2++) {
1049 double cached_theta_q_m2 =
thetaQm(q_m2);
1050 double delta = (q_m1 == q_m2) ? 1. : 2.;
1052 for (
int i = 0; i < N; i++) {
1053 for (
int j = 0; j < N; j++) {
1054 residual_norm_sq += delta * mass_coeffs.getEntry(i) * mass_coeffs.getEntry(j)
1055 * cached_theta_q_m1 * cached_theta_q_m2 * Mq_Mq_representor_norms[q][i][j];
1062 for (
int q_f = 0; q_f <
getQf(); q_f++) {
1063 double cached_theta_q_f =
thetaQf(q_f);
1065 for (
int q_m = 0; q_m <
getQm(); q_m++) {
1066 double cached_theta_q_m =
thetaQm(q_m);
1068 for (
int i = 0; i < N; i++) {
1069 residual_norm_sq += 2. * mass_coeffs.getEntry(i) * cached_theta_q_f * cached_theta_q_m
1070 * Fq_Mq_representor_norms[q_f][q_m][i];
1075 for (
int q_a = 0; q_a <
getQa(); q_a++) {
1076 double cached_theta_q_a =
thetaQa(q_a);
1077 for (
int q_m = 0; q_m <
getQm(); q_m++) {
1078 double cached_theta_q_m =
thetaQm(q_m);
1080 for (
int i = 0; i < N; i++) {
1081 for (
int j = 0; j < N; j++) {
1082 residual_norm_sq += 2. * RB_u_euler_theta.getEntry(i) * mass_coeffs.getEntry(j)
1083 * cached_theta_q_a * cached_theta_q_m * Aq_Mq_representor_norms[q_a][q_m][i][j];
1089 if (residual_norm_sq < 0) {
1090 Log.d(DEBUG_TAG,
"Warning: Square of residual norm is negative "
1091 +
"in TransientRBSystem::compute_residual_dual_norm()");
1096 residual_norm_sq = Math.abs(residual_norm_sq);
1099 return Math.sqrt(residual_norm_sq);
GeometryData getGeometry()
The model's geometry data.
double thetaQm(int i, double t)
Evaluate theta_q_m (for the q^th mass matrix term) at the current parameter.
int getVisualNumTimesteps()
double compute_output_dual_norm(int i, double t)
Compute the dual norm of the i^th output function at the current parameter value. ...
void cache_online_residual_terms(int N)
Helper function that caches the time-independent residual quantities.
float[][][] fullBasisVectors
int getNumDoFFields()
Returns the number of degree-of-freedom fields generated/computed by the model.
Utility helper class from rbAppMIT included for compatibility of rbAppMIT model loading.
double residual_scaling_denom(double alpha_LB)
Specifies the residual scaling on the denominator to be used in the a posteriori error bound...
This class provides the Online stage for the reduced basis method for elliptic steady state problems...
The default solution field containing an array of real values.
RealMatrix RB_L2_matrix
A secondary SCM object since we might need a lower bound for the mass matrix and the stiffness matrix...
double[][][] Fq_Aq_representor_norms
Represents the results of a simulation.
This class provides the Online reduced basis functionality for linear parabolic problems.
Interface for AffineFunctions in unsteady rb systems.
Reading matrices and vectors with a bunch of convenient overloads for different sources and output fo...
RealVector getInitialCoefficients(int N)
Returns the initial conditions solution coefficients for RB size N.
int timestep
The current time-level, 0 <= _k <= _K.
Parameters getParams()
Returns the system's parameters object.
void readConfigurationRBAppMIT(GetPot infile)
double[][][] Aq_Aq_representor_norms
double thetaQl(int k, int i)
double compute_residual_dual_norm(int N)
Compute the dual norm of the residual for the solution saved in RB_solution_vector.
IAffineFunctions affineFunctionsInstance
The member object that defines the parameter-dependent functions for the affine expansion of the left...
boolean return_rel_error_bound
Boolean flag to indicate whether RB_solve returns an absolute or relative error bound.
double[] Fq_representor_norms
Arrays storing the residual representor inner products to be used in computing the residuals in the O...
void readConfigurationJRB(AModelManager m)
double conv_weight(double x)
double thetaQa(int q)
Evaluate theta_q_a (for the q^th bilinear form) at the current parameter.
RealVector old_RB_solution
RBSystem has a member RB_solution, we also need old_RB_solution here.
This class serves as base class for accessing various types of models at different locations...
RealMatrix[] RB_M_q_matrix
Dense matrices for the RB computations.
void apply_temporal_filter()
Apply the temporal filter to the outputs.
RealVector[] timestepRBSolutions
The solution coefficients at each time level from the most recent RB_solve.
int getQf()
TODO: if all affine_functions implement the IAffineFunctions interface, just call the getQf method of...
double uncached_compute_residual_dual_norm(int N)
Set the secondary SCM system.
RealVector RB_solution
The RB solution vector.
void setTimeStep(int k_in)
FieldDescriptor[] logicalFieldTypes
The logical output fields of the model, each collecting one ore more model DoF's into a related unit...
double getEulerTheta()
Get/set euler_theta, parameter that determines the temporal discretization.
double getdt()
Gets dt, the time-step size.
Provides a Log class imitating the Android Log class when not used on android systems.
void initialize_data_vectors()
Resize the output vectors according to n_outputs.
double[][] RB_output_error_bounds_all_k
The output error bounds at all time levels.
RealMatrix[] RB_A_q_vector
Dense matrices for the RB computations.
double residual_scaling_numer(double alpha_LB)
Specifies the residual scaling on the numerator to be used in the a posteriori error bound...
double RB_solve(int N)
Perform online solve with the N RB basis functions, for the set of parameters in current_params, where 1 <= N <= RB_size.
double[][] RB_outputs_all_k
The outputs at all time levels.
RealVector[][] RB_output_vectors
The vectors storing the RB output vectors.
double[] error_bound_all_k
The error bound for the field variable at each time level.
int getTotalTimesteps()
Get K, the total number of time-steps.
RealVector[] RB_F_q_vector
Dense vector for the RHS.
double thetaQm(int i)
Evaluate theta_q_m (for the q^th mass matrix term) at the current parameter.
void loadOfflineDataJRB(AModelManager m)
Override read_offline_data_from_files in order to read in the mass matrix and initial condition data ...
void loadOfflineData_rbappmit(AModelManager m)
Override read_offline_data_from_files in order to read in the mass matrix and initial condition data ...
Contains information about the logical solution fields.
SimulationResult getSimulationResults()
Returns the animated results of the transient RB system.
int getQl(int output_index)
TODO: if all affine_functions implement the IAffineFunctions interface, just call the getQl method of...
int fTotalTimesteps
Total number of time-steps.
double get_SCM_lower_bound()
int n_plotting_steps
The number of time steps we actually plot in the output plotter.