JaRMoS  1.1
Java Reduced Model Simulations
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
SimulationResult.java
Go to the documentation of this file.
1 package jarmos;
2 
5 
6 import java.util.ArrayList;
7 import java.util.List;
8 
18 public class SimulationResult {
19 
20  private List<LogicSolutionField> fields;
21  private int parts;
22  private List<MeshTransform> transforms;
23  private boolean hasDispl;
24 
32  public int getNumParts() {
33  return parts;
34  }
35 
36  public boolean hasDisplacements() {
37  return hasDispl;
38  }
39 
40  public SimulationResult(int parts) {
41  fields = new ArrayList<LogicSolutionField>();
42  transforms = new ArrayList<MeshTransform>();
43  this.parts = parts;
44  hasDispl = false;
45  }
46 
47  public void addField(LogicSolutionField field) {
48  // Perform some checks for consistency
49  for (LogicSolutionField f : fields) {
50  // assert f.getSize() == field.getSize();
51  if (f.getSize() != field.getSize())
52  throw new RuntimeException(
53  "Inconsistency! Cannot add solution field to collection as the size does not equal the size of already present fields.");
54  }
55  hasDispl |= field instanceof DisplacementField;
56  fields.add(field);
57  }
58 
59  public void addTransform(MeshTransform m) {
60  transforms.add(m);
61  }
62 
63  public List<MeshTransform> getTransforms() {
64  return transforms;
65  }
66 
72  public int getNumValueFields() {
73  return fields.size();
74  }
75 
76  public LogicSolutionField getField(int nr) {
77  return fields.get(nr);
78  }
79 
80  public List<LogicSolutionField> getLogicFields() {
81  return fields;
82  }
83 }
The displacement field is a logical solution field describing displacements of geometry nodes/vertice...
Represents a logical solution field of a simulation.
void addField(LogicSolutionField field)
Represents the results of a simulation.
int getNumParts()
The number of parts in each LogicSolutionField.
void addTransform(MeshTransform m)
int getNumValueFields()
Returns the number of solution fields.
List< MeshTransform > getTransforms()
LogicSolutionField getField(int nr)
A common interface for classes providing a mesh transformation.
List< LogicSolutionField > getLogicFields()