FEDEM Solver  R8.0
Source code of the dynamics solver
FFaResultDescription.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FFA_RESULT_DESCRIPTION_H
14 #define FFA_RESULT_DESCRIPTION_H
15 
16 #include <vector>
17 #include <string>
18 
19 
31 {
32 public:
34  FFaResultDescription(const char* name = NULL, int bid = 0, int uid = 0)
35  : baseId(bid), userId(uid) { if (name) OGType = name; }
37  virtual ~FFaResultDescription() {}
38 
40  void clear();
42  void copyResult(const FFaResultDescription& other);
43 
45  std::string getText() const;
46 
48  bool isTime() const;
50  bool isBeamSectionResult() const;
52  bool empty() const { return OGType.empty() && varDescrPath.empty(); }
53 
55  bool operator==(const FFaResultDescription& entry) const;
56 
57  std::string OGType;
58  int baseId;
59  int userId;
60 
61  std::string varRefType;
62  std::vector<std::string> varDescrPath;
63 };
64 
65 
71 {
72 public:
76  virtual ~FFaTimeDescription() {}
77 };
78 
79 
81 std::ostream& operator<<(std::ostream&, const FFaResultDescription&);
83 std::istream& operator>>(std::istream&, FFaResultDescription&);
84 
85 #endif
std::ostream & operator<<(std::ostream &, const FFaResultDescription &)
Global output stream operator.
Definition: FFaResultDescription.C:85
std::istream & operator>>(std::istream &, FFaResultDescription &)
Global input stream operator.
Definition: FFaResultDescription.C:101
Class representing a result variable description.
Definition: FFaResultDescription.H:31
bool isBeamSectionResult() const
Returns true if this describes a beam section result quantity.
Definition: FFaResultDescription.C:66
std::string varRefType
Variable type description.
Definition: FFaResultDescription.H:61
std::string OGType
Top-level variable type (owner group)
Definition: FFaResultDescription.H:57
void copyResult(const FFaResultDescription &other)
Copies the result path (but leaves the type and ID untouched).
Definition: FFaResultDescription.C:30
bool operator==(const FFaResultDescription &entry) const
Equality operator.
Definition: FFaResultDescription.C:76
bool empty() const
Returns true if this result description is empty (no results).
Definition: FFaResultDescription.H:52
void clear()
Clears the result description, resetting it to default values.
Definition: FFaResultDescription.C:21
bool isTime() const
Returns true if this describes a time-dependent result quantity.
Definition: FFaResultDescription.C:59
int userId
Unique only within owner group.
Definition: FFaResultDescription.H:59
int baseId
Unique ID over the entire model.
Definition: FFaResultDescription.H:58
std::vector< std::string > varDescrPath
Below top-level variable.
Definition: FFaResultDescription.H:62
FFaResultDescription(const char *name=NULL, int bid=0, int uid=0)
Default constructor.
Definition: FFaResultDescription.H:34
virtual ~FFaResultDescription()
Empty destructor.
Definition: FFaResultDescription.H:37
std::string getText() const
Returns a textural description of the result path.
Definition: FFaResultDescription.C:37
Sub-class representing the physical time.
Definition: FFaResultDescription.H:71
virtual ~FFaTimeDescription()
Empty destructor.
Definition: FFaResultDescription.H:76
FFaTimeDescription()
Default constructor.
Definition: FFaResultDescription.C:14