JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
rb.RBSystem Class Reference

This class provides the Online stage for the reduced basis method for elliptic steady state problems. More...

Inheritance diagram for rb.RBSystem:
jarmos.ModelBase rb.ComplexRBSystem rb.TransientRBSystem rb.QNTransientRBSystem

Public Member Functions

 RBSystem ()
 Constructor. More...
 
FieldVector< Complex > complex_eval_theta_q_a ()
 
Complex complex_eval_theta_q_a (int q)
 
Complex complex_eval_theta_q_f (int q)
 
Complex complex_eval_theta_q_l (int n, int q)
 
int get_N ()
 
double get_RB_output (int n_output, boolean Rpart)
 
double get_RB_output_error_bound (int n_output, boolean Rpart)
 
double get_SCM_lower_bound ()
 
RealVector getInitialCoefficients (int N)
 Returns the initial conditions solution coefficients for RB size N. More...
 
int getNBF ()
 
int getNumOutputs ()
 
Parameters getParams ()
 Returns the system's parameters object. More...
 
int getQa ()
 
int getQf ()
 TODO: if all affine_functions implement the IAffineFunctions interface, just call the getQf method of the local instance. More...
 
int getQuL ()
 
SimulationResult getSimulationResults ()
 Constructs the true solution from the most recent RB reduced solution using the full Z data and current coefficients. More...
 
double getSweepIncrement ()
 Returns the increment used during the last parameter sweep or zero if there hasn't been any. More...
 
double[][] getSweepOutputBounds ()
 
double[][] getSweepOutputs ()
 
SimulationResult getSweepSimResults ()
 
int getTotalTimesteps ()
 TODO check where this is used. More...
 
int getVisualNumTimesteps ()
 
void loadOfflineData (AModelManager m) throws MathReaderException, ModelManagerException, IOException
 Loads the offline data for the RBSystem. More...
 
float[] rbappmitCustomMeshTransform (double[] mu, float[] x)
 Custom mesh transformation method of old rbappmit-models. More...
 
int performSweep (int sweepIndex, int N)
 Performs a parameter sweep with automatic guess of the number of parameter sweeps. More...
 
int performSweep (int sweepIndex, int N, int numSweepPts)
 Performs a parameter sweep for the current RB system. More...
 
final boolean readConfiguration (AModelManager m)
 
void set_n_basis_functions (int _N)
 
void setPrimarySCM (RBSCMSystem scm_system)
 Set the primary SCM. More...
 
double computeRBSolution (int N)
 Performs a reduced basis simulation and stores the results locally. More...
 
double thetaQa (int q)
 Evaluate theta_q_a (for the q^th bilinear form) at the current parameter. More...
 
double thetaQa (int q, double t)
 
double thetaQf (int i)
 
double thetaQf (int i, double t)
 
double thetaQl (int k, int i)
 
double thetaQl (int k, int i, double t)
 
- Public Member Functions inherited from jarmos.ModelBase
void loadOfflineData (AModelManager m) throws MathReaderException, ModelManagerException, IOException
 Loads the model's offline data. More...
 
GeometryData getGeometry ()
 The model's geometry data. More...
 
int getNumDoFFields ()
 Returns the number of degree-of-freedom fields generated/computed by the model. More...
 

Public Attributes

Class< IAffineFunctionsaffineFunctionsClass
 The Class object for the affine functions class. More...
 
IAffineFunctions affineFunctionsInstance
 The member object that defines the parameter-dependent functions for the affine expansion of the left-hand, right-hand side and outputs. More...
 
boolean isReal = true
 
RBSCMSystem mRbScmSystem
 A reference to the SCM system. More...
 
Class<?> oldAffFcnCl
 
Object oldAffFcnObj
 
double[][] output_dual_norms
 This array stores the dual norms for each output. More...
 
double[] RB_output_error_bounds
 The vector storing the RB error bounds in the steady-state case. More...
 
double[][] RB_output_error_bounds_all_k
 The output error bounds at all time levels. More...
 
double[] RB_outputs
 The vector storing the RB output values in the steady-state case. More...
 
double[][] RB_outputs_all_k
 The outputs at all time levels. More...
 
boolean return_rel_error_bound
 Boolean flag to indicate whether RB_solve returns an absolute or relative error bound. More...
 

Protected Member Functions

double compute_output_dual_norm (int i, double t)
 Compute the dual norm of the i^th output function at the current parameter value. More...
 
double compute_residual_dual_norm (int N)
 Compute the dual norm of the residual for the solution saved in RB_solution_vector. More...
 
double[][] get_RBsolution ()
 
double get_SCM_from_AffineFunction ()
 A private helper function to get the SCM from AffineFunctions in the case that SCM_TYPE = NONE. More...
 
int getQl (int output_index)
 TODO: if all affine_functions implement the IAffineFunctions interface, just call the getQl method of the local instance. More...
 
float[][] getAffLinTransformationData (double[] mu)
 Returns a float array of transformation data for each node, using the specified parameter mu. More...
 
boolean hasCustomMeshTransform ()
 
boolean hasAffLinTransformationData ()
 
void initialize_data_vectors ()
 Resize the vectors that store solution data and output data. More...
 
void loadOfflineData_rbappmit (AModelManager m) throws IOException
 
void loadOfflineDataJRB (AModelManager m) throws IOException
 
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. More...
 
void readConfigurationJRB (AModelManager m)
 
void readConfigurationRBAppMIT (GetPot infile)
 
double residual_scaling_denom (double alpha_LB)
 Specifies the residual scaling on the denominator to be used in the a posteriori error bound. More...
 
void setParams (Parameters p)
 Only used to set the current parameters object for an SCMSystem, as this also inherits from the RBBase class. More...
 

Protected Attributes

double[][][] Aq_Aq_representor_norms
 
int current_N
 
double[][][] Fq_Aq_representor_norms
 
double[] Fq_representor_norms
 Arrays storing the residual representor inner products to be used in computing the residuals in the Online stage. More...
 
float[][][] fullBasisVectors
 
RealMatrix[] RB_A_q_vector
 Dense matrices for the RB computations. More...
 
RealVector[] RB_F_q_vector
 Dense vector for the RHS. More...
 
RealVector[][] RB_output_vectors
 The vectors storing the RB output vectors. More...
 
RealVector RB_solution
 The RB solution vector. More...
 
double[][][] RB_sweep_solution
 
float[][] uL_vector
 
List< MeshTransformtransforms
 
- Protected Attributes inherited from jarmos.ModelBase
FieldDescriptor[] logicalFieldTypes
 The logical output fields of the model, each collecting one ore more model DoF's into a related unit, like displacements which have 2-3 DoF-fields (x,y,z) More...
 

Package Functions

double get_SCM_upper_bound ()
 
double get_soln_coeff (int i)
 

Detailed Description

This class provides the Online stage for the reduced basis method for elliptic steady state problems.

This class has been taken from the original rbAppMIT package and modified to fit into the current JaRMoS framework.

Author
Daniel Wirtz
Date
Aug 28, 2011
Todo:

import & use implicit operators LL_I from rbmatlab

report progress for transient RB systems and/or normal systems

Definition at line 54 of file RBSystem.java.

Constructor & Destructor Documentation

rb.RBSystem.RBSystem ( )

Constructor.

Definition at line 225 of file RBSystem.java.

Member Function Documentation

FieldVector<Complex> rb.RBSystem.complex_eval_theta_q_a ( )

Definition at line 238 of file RBSystem.java.

Complex rb.RBSystem.complex_eval_theta_q_a ( int  q)

Definition at line 277 of file RBSystem.java.

Complex rb.RBSystem.complex_eval_theta_q_f ( int  q)

Definition at line 317 of file RBSystem.java.

Complex rb.RBSystem.complex_eval_theta_q_l ( int  n,
int  q 
)

Definition at line 357 of file RBSystem.java.

double rb.RBSystem.compute_output_dual_norm ( int  i,
double  t 
)
protected

Compute the dual norm of the i^th output function at the current parameter value.

Definition at line 402 of file RBSystem.java.

double rb.RBSystem.compute_residual_dual_norm ( int  N)
protected

Compute the dual norm of the residual for the solution saved in RB_solution_vector.

Definition at line 423 of file RBSystem.java.

double rb.RBSystem.computeRBSolution ( int  N)

Performs a reduced basis simulation and stores the results locally.

Access via getSimulationResults

Parameters
N
Returns

If this system is unsteady dont perform geometric transformations (not checked yet/no models there yet) Comes from the LINEAR_STEADY / LINEAR_COMPLEX_STEADY enums in ROMSim/rbappmit, where the check was made originally.

Definition at line 1617 of file RBSystem.java.

int rb.RBSystem.get_N ( )
Parameters
mu
gData

Definition at line 499 of file RBSystem.java.

double rb.RBSystem.get_RB_output ( int  n_output,
boolean  Rpart 
)

Definition at line 503 of file RBSystem.java.

double rb.RBSystem.get_RB_output_error_bound ( int  n_output,
boolean  Rpart 
)

Definition at line 507 of file RBSystem.java.

double [][] rb.RBSystem.get_RBsolution ( )
protected

Definition at line 511 of file RBSystem.java.

double rb.RBSystem.get_SCM_from_AffineFunction ( )
protected

A private helper function to get the SCM from AffineFunctions in the case that SCM_TYPE = NONE.

Definition at line 518 of file RBSystem.java.

double rb.RBSystem.get_SCM_lower_bound ( )
Returns
the SCM lower bound for current_parameters

Definition at line 551 of file RBSystem.java.

double rb.RBSystem.get_SCM_upper_bound ( )
package
Returns
the SCM upper bound for current_parameters

Definition at line 563 of file RBSystem.java.

double rb.RBSystem.get_soln_coeff ( int  i)
package
Returns
coefficient i of RB_solution from the most recent RB_solve.

Definition at line 575 of file RBSystem.java.

float [][] rb.RBSystem.getAffLinTransformationData ( double[]  mu)
protected

Returns a float array of transformation data for each node, using the specified parameter mu.

Only to be called for models who have a parameterized geometry.

The get_local_transformation method of the AffineFunctions class is called (using the current parameter ) and the linear transform function returned.

Returns

Definition at line 852 of file RBSystem.java.

RealVector rb.RBSystem.getInitialCoefficients ( int  N)

Returns the initial conditions solution coefficients for RB size N.

TODO: Use this method in any RB_Solve member in subclasses!

Parameters
NThe RB size
Returns
The initial solution coefficient vector of size N

Definition at line 588 of file RBSystem.java.

int rb.RBSystem.getNBF ( )
Returns
The number of basis functions in the system.

Definition at line 605 of file RBSystem.java.

int rb.RBSystem.getNumOutputs ( )
Returns
the number of output functionals

Definition at line 612 of file RBSystem.java.

Parameters rb.RBSystem.getParams ( )

Returns the system's parameters object.

Returns
The current parameters

Definition at line 621 of file RBSystem.java.

int rb.RBSystem.getQa ( )
Returns
Q_a, the number of term in the affine expansion of the bilinear form

Definition at line 628 of file RBSystem.java.

int rb.RBSystem.getQf ( )

TODO: if all affine_functions implement the IAffineFunctions interface, just call the getQf method of the local instance.

Returns
Q_f, the number of term in the affine expansion of the right-hand side

Definition at line 638 of file RBSystem.java.

int rb.RBSystem.getQl ( int  output_index)
protected

TODO: if all affine_functions implement the IAffineFunctions interface, just call the getQl method of the local instance.

Parameters
output_indexThe index of the output we are interested in
Returns
the number of terms in the affine expansion of the specified output

Definition at line 650 of file RBSystem.java.

int rb.RBSystem.getQuL ( )

Definition at line 654 of file RBSystem.java.

SimulationResult rb.RBSystem.getSimulationResults ( )

Constructs the true solution from the most recent RB reduced solution using the full Z data and current coefficients.

Attention
This is a "hack" as the former rbAppMIT had only a limited number of models, of which all visualization has been organized a certain way (previously coded inside the RBVisualization.onCreate method). This is as follows: One field: Only field values Two fields: If not transient, it is 2D displacement data Three fields: If not transient, it is 3D displacement data Four fields: If not transient, it is 3D displacement and a fourth field with normal values.
See Also
ComplexRBSystem for an overridden version of this method.
Returns

Definition at line 672 of file RBSystem.java.

double rb.RBSystem.getSweepIncrement ( )

Returns the increment used during the last parameter sweep or zero if there hasn't been any.

Returns

Definition at line 746 of file RBSystem.java.

double [][] rb.RBSystem.getSweepOutputBounds ( )

Definition at line 750 of file RBSystem.java.

double [][] rb.RBSystem.getSweepOutputs ( )

Definition at line 754 of file RBSystem.java.

SimulationResult rb.RBSystem.getSweepSimResults ( )

Definition at line 758 of file RBSystem.java.

int rb.RBSystem.getTotalTimesteps ( )

TODO check where this is used.

Returns

Definition at line 838 of file RBSystem.java.

int rb.RBSystem.getVisualNumTimesteps ( )

Definition at line 866 of file RBSystem.java.

boolean rb.RBSystem.hasAffLinTransformationData ( )
protected

Definition at line 895 of file RBSystem.java.

boolean rb.RBSystem.hasCustomMeshTransform ( )
protected
Returns

Definition at line 873 of file RBSystem.java.

void rb.RBSystem.initialize_data_vectors ( )
protected

Resize the vectors that store solution data and output data.

Definition at line 902 of file RBSystem.java.

void rb.RBSystem.loadOfflineData ( AModelManager  m) throws MathReaderException, ModelManagerException, IOException

Loads the offline data for the RBSystem.

Parameters
m
Exceptions
IOException

Definition at line 915 of file RBSystem.java.

void rb.RBSystem.loadOfflineData_rbappmit ( AModelManager  m) throws IOException
protected
Parameters
m
Exceptions
IOException

Definition at line 931 of file RBSystem.java.

void rb.RBSystem.loadOfflineDataJRB ( AModelManager  m) throws IOException
protected

Definition at line 1172 of file RBSystem.java.

int rb.RBSystem.performSweep ( int  sweepIndex,
int  N 
)

Performs a parameter sweep with automatic guess of the number of parameter sweeps.

Parameters
sweepIndex
N
Returns
The number of sweeps performed

Definition at line 1340 of file RBSystem.java.

int rb.RBSystem.performSweep ( int  sweepIndex,
int  N,
int  numSweepPts 
)

Performs a parameter sweep for the current RB system.

Parameters
sweepIndexThe index of the parameter to sweep
NThe reduced basis size for sweeping
numSweepPtsThe desired number of sweep points
Returns
The number of sweeps effectively performed

Definition at line 1357 of file RBSystem.java.

double rb.RBSystem.RB_solve ( int  N)
protected

Perform online solve with the N RB basis functions, for the set of parameters in current_params, where 1 <= N <= RB_size.

Definition at line 1429 of file RBSystem.java.

float [] rb.RBSystem.rbappmitCustomMeshTransform ( double[]  mu,
float[]  x 
)

Custom mesh transformation method of old rbappmit-models.

Parameters
mu
x
Returns

Definition at line 1300 of file RBSystem.java.

final boolean rb.RBSystem.readConfiguration ( AModelManager  m)
Parameters
m
Returns

Definition at line 1506 of file RBSystem.java.

void rb.RBSystem.readConfigurationJRB ( AModelManager  m)
protected

Definition at line 1525 of file RBSystem.java.

void rb.RBSystem.readConfigurationRBAppMIT ( GetPot  infile)
protected

Definition at line 1541 of file RBSystem.java.

double rb.RBSystem.residual_scaling_denom ( double  alpha_LB)
protected

Specifies the residual scaling on the denominator to be used in the a posteriori error bound.

Overload in subclass in order to obtain the desired error bound.

Definition at line 1587 of file RBSystem.java.

void rb.RBSystem.set_n_basis_functions ( int  _N)

Definition at line 1591 of file RBSystem.java.

void rb.RBSystem.setParams ( Parameters  p)
protected

Only used to set the current parameters object for an SCMSystem, as this also inherits from the RBBase class.

Parameters
p

Definition at line 1600 of file RBSystem.java.

void rb.RBSystem.setPrimarySCM ( RBSCMSystem  scm_system)

Set the primary SCM.

Definition at line 1607 of file RBSystem.java.

double rb.RBSystem.thetaQa ( int  q)

Evaluate theta_q_a (for the q^th bilinear form) at the current parameter.

Parameters
q
Returns

Definition at line 1681 of file RBSystem.java.

double rb.RBSystem.thetaQa ( int  q,
double  t 
)
Parameters
q
t
Returns

Definition at line 1691 of file RBSystem.java.

double rb.RBSystem.thetaQf ( int  i)
Parameters
i
Returns

Definition at line 1700 of file RBSystem.java.

double rb.RBSystem.thetaQf ( int  i,
double  t 
)
Parameters
i
t
Returns

Definition at line 1710 of file RBSystem.java.

double rb.RBSystem.thetaQl ( int  k,
int  i 
)
Parameters
k
i
Returns

Definition at line 1720 of file RBSystem.java.

double rb.RBSystem.thetaQl ( int  k,
int  i,
double  t 
)
Parameters
k
i
t
Returns

Definition at line 1731 of file RBSystem.java.

Member Data Documentation

Class<IAffineFunctions> rb.RBSystem.affineFunctionsClass

The Class object for the affine functions class.

Implements the interface import rb.affinefcn.IAffineFunctions.

Definition at line 69 of file RBSystem.java.

IAffineFunctions rb.RBSystem.affineFunctionsInstance

The member object that defines the parameter-dependent functions for the affine expansion of the left-hand, right-hand side and outputs.

We need to access this object at runtime, hence we use a ClassLoader and reflection in order to call the relevant functions.

Definition at line 75 of file RBSystem.java.

double [][][] rb.RBSystem.Aq_Aq_representor_norms
protected

Definition at line 77 of file RBSystem.java.

int rb.RBSystem.current_N
protected

Definition at line 80 of file RBSystem.java.

double [][][] rb.RBSystem.Fq_Aq_representor_norms
protected

Definition at line 85 of file RBSystem.java.

double [] rb.RBSystem.Fq_representor_norms
protected

Arrays storing the residual representor inner products to be used in computing the residuals in the Online stage.

These are resized by reading in the Offline data written out by rbOOmit.

Definition at line 91 of file RBSystem.java.

float [][][] rb.RBSystem.fullBasisVectors
protected

Definition at line 114 of file RBSystem.java.

boolean rb.RBSystem.isReal = true

Definition at line 119 of file RBSystem.java.

RBSCMSystem rb.RBSystem.mRbScmSystem

A reference to the SCM system.

Definition at line 124 of file RBSystem.java.

Class<?> rb.RBSystem.oldAffFcnCl
Deprecated:
Here for rbAppMIT compatibility.

Definition at line 139 of file RBSystem.java.

Object rb.RBSystem.oldAffFcnObj
Deprecated:
Here for rbAppMIT compatibility.

Definition at line 144 of file RBSystem.java.

double [][] rb.RBSystem.output_dual_norms

This array stores the dual norms for each output.

Row n stores the Q_l dual norms for the expansion of the n^th output.

Definition at line 150 of file RBSystem.java.

RealMatrix [] rb.RBSystem.RB_A_q_vector
protected

Dense matrices for the RB computations.

Definition at line 163 of file RBSystem.java.

RealVector [] rb.RBSystem.RB_F_q_vector
protected

Dense vector for the RHS.

Definition at line 168 of file RBSystem.java.

double [] rb.RBSystem.RB_output_error_bounds

The vector storing the RB error bounds in the steady-state case.

Definition at line 178 of file RBSystem.java.

double [][] rb.RBSystem.RB_output_error_bounds_all_k

The output error bounds at all time levels.

Definition at line 183 of file RBSystem.java.

RealVector [][] rb.RBSystem.RB_output_vectors
protected

The vectors storing the RB output vectors.

Definition at line 187 of file RBSystem.java.

double [] rb.RBSystem.RB_outputs

The vector storing the RB output values in the steady-state case.

Definition at line 191 of file RBSystem.java.

double [][] rb.RBSystem.RB_outputs_all_k

The outputs at all time levels.

Definition at line 197 of file RBSystem.java.

RealVector rb.RBSystem.RB_solution
protected

The RB solution vector.

Stored as a Vector so that we can easily resize it during an RB_solve.

Definition at line 201 of file RBSystem.java.

double [][][] rb.RBSystem.RB_sweep_solution
protected

Definition at line 203 of file RBSystem.java.

boolean rb.RBSystem.return_rel_error_bound

Boolean flag to indicate whether RB_solve returns an absolute or relative error bound.

True => relative, false => absolute.

Definition at line 209 of file RBSystem.java.

List<MeshTransform> rb.RBSystem.transforms
protected

Definition at line 220 of file RBSystem.java.

float [][] rb.RBSystem.uL_vector
protected

Definition at line 218 of file RBSystem.java.


The documentation for this class was generated from the following file: