6 import static org.junit.Assert.assertTrue;
7 import static org.junit.Assert.fail;
15 import org.junit.Test;
25 public class TestRBSolve {
31 public void testRBSolveJRB() {
32 FileModelManager f =
new FileModelManager(
"models");
34 f.useModel(
"rbm_advec");
35 }
catch (ModelManagerException e) {
40 RBContainer rb =
new RBContainer();
41 assertTrue(rb.loadModel(f));
44 RBSystem s = rb.mRbSystem;
46 double[] par =
new double[] { .5, .5 };
47 s.getParams().setCurrent(par);
48 s.computeRBSolution(4);
55 public void testRBSolveJRB_TimeConst() {
56 FileModelManager f =
new FileModelManager(
"models");
58 f.useModel(
"rbm_advec");
59 }
catch (ModelManagerException e) {
64 RBContainer rb =
new RBContainer();
65 assertTrue(rb.loadModel(f));
68 RBSystem s = rb.mRbSystem;
70 double[] par =
new double[] { .5, .5, .5 };
71 s.getParams().setCurrent(par);
72 s.computeRBSolution(4);
74 SimulationResult sol = s.getSimulationResults();
76 GeometryData g =
new GeometryData();
77 g.loadModelGeometry(f);
78 VisualizationData d =
new VisualizationData(g);
80 d.computeVisualFeatures(
new ColorGenerator());
87 public void testRBSolverbappmit() {
88 FileModelManager f =
new FileModelManager(
"models");
91 }
catch (ModelManagerException e) {
96 RBContainer rb =
new RBContainer();
97 assertTrue(rb.loadModel(f));
100 RBSystem s = rb.mRbSystem;
101 double[] par = s.getParams().getRandomParam();
103 s.getParams().setCurrent(par);
104 s.computeRBSolution(s.getNBF() / 2);
106 SimulationResult res = s.getSimulationResults();
107 GeometryData g = rb.mRbSystem.getGeometry();
108 VisualizationData v =
new VisualizationData(g);
111 v.computeVisualFeatures(
new ColorGenerator());
This class provides the Online stage for the reduced basis method for elliptic steady state problems...
Represents the results of a simulation.
Manages models loaded from the file system available via the java.io classes.
Base class for RB models and systems.
A container class for all model visual data.
This Exception gets thrown when an error occurs regarding the functionality of the ModelManager...
This is a container class for all geometry-related data of a reduced model.
The color generator is used to produce RGBA (RGB+Alpha) values from a given array of floats...