FEDEM Model Database  R8.0
Source code of the FEDEM model database
FFlNode.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 
8 #ifndef FFL_NODE_H
9 #define FFL_NODE_H
10 
11 #include "FFlLib/FFlPartBase.H"
12 #include "FFlLib/FFlTypeInfoSpec.H"
13 #include "FFlLib/FFlReference.H"
14 #ifdef FT_USE_MEMPOOL
16 #endif
17 #ifndef FT_USE_VERTEX
19 #else
20 class FaVec3;
21 #endif
22 class FFaCheckSum;
23 class FFaUnitCalculator;
24 class FFlFEResultBase;
25 class FFlFENodeResult;
26 
27 #ifdef FF_NAMESPACE
28 namespace FF_NAMESPACE {
29 #endif
30 
31 #ifdef FT_USE_VERTEX
32 class FFlVertex;
33 #endif
34 class FFlAttributeBase;
35 class FFlPCOORDSYS;
36 
37 
38 class FFlNode : public FFlPartBase
39 {
40 public:
41  FFlNode(int ID);
42  FFlNode(int ID, double x, double y, double z, int s = 0);
43  FFlNode(int ID, const FaVec3& pos, int s = 0);
44  FFlNode(const FFlNode& node);
45  virtual ~FFlNode();
46 
47  FFlNode& operator=(const FFlNode&) = delete;
48  FFlNode* clone() const { return new FFlNode(*this); }
49 
50  static void init();
51 
53 
54  void calculateChecksum(FFaCheckSum* cs, int precision,
55  bool includeExtNodeInfo);
56  void convertUnits(const FFaUnitCalculator* convCal);
57 
58  // Vertex management:
59 
60 #ifdef FT_USE_VERTEX
61  int getVertexID() const;
62 
63  void setVertex(FFlVertex* aVertex);
64  FFlVertex* getVertex() const { return myVertex; }
65  const FaVec3& getPos() const;
66  FaVec3& position() { return const_cast<FaVec3&>(this->getPos()); }
67 #else
68  const FaVec3& getPos() const { return myPos; }
69  FaVec3& position() { return myPos; }
70 #endif
71 
72  // Node status management:
73 
74  enum { INTERNAL = 0, EXTERNAL = 1, SLAVENODE = 2, REFNODE = 3 };
75 
76  bool setStatus(int newStat);
77  int getStatus(int ignore = 0) const { return status > ignore ? status : 0; }
78 
79  bool setExternal(bool ext = true);
80  bool isFixed(int dof = 0) const;
81  bool isExternal() const { return status == 1; }
82  bool isSlaveNode() const { return status >= 2; }
83  bool isRefNode() const { return status == 3; }
84  bool isAttachable() const { return status >= 0 && status != 2; }
85 
86  // Local dofs management:
87 
88  enum { FFL_ALL_DOFS = -1, FFL_THREE_DOFS = 3, FFL_SIX_DOFS = 6 };
89 
90  void pushDOFs(int dofs) { if (dofs > myDOFCount) myDOFCount = dofs; }
91  bool hasDOFs(int dofs = 1) const { return myDOFCount >= dofs; }
92  int getMaxDOFs() const { return myDOFCount; }
93 
94  // Local coordinate system management:
95 
96  void setLocalSystem(const FFlPCOORDSYS* coorSys);
97  void setLocalSystem(int ID) { myLocalSystem = ID; }
98 
99  bool resolveLocalSystem(const std::map<int,FFlAttributeBase*>& possibleCSs,
100  bool suppressErrmsg = false);
101 
102  bool hasLocalSystem() const { return myLocalSystem.isResolved(); }
103  int getLocalSystemID() const;
104  FFlPCOORDSYS* getLocalSystem() const;
105 
106  // Nodal result management:
107 
108  bool hasResults() const { return myResults == NULL ? false : true; }
109  FFlFENodeResult* getResults();
110  void deleteResults();
111 
112 protected:
113  char status; // 0=internal, 1=external, 2=slavenode(internal)
115 #ifdef FT_USE_VERTEX
116  FFlVertex* myVertex;
117 #else
119 #endif
121 
122  FFlReference<FFlAttributeBase> myLocalSystem; // solution coordinate system
123 
124 #ifdef FT_USE_MEMPOOL
126 #endif
127 };
128 
129 #ifdef FF_NAMESPACE
130 } // namespace
131 #endif
132 #endif
Streamlined efficient memory allocation.
#define FFA_MAKE_MEMPOOL
Macro adding memory pool features to a class.
Definition: FFaMemPool.H:139
Point vectors in 3D space.
static std::array< std::string, 6 > dof
Definition: FmJointBase.C:111
Class for holding and calculation of checksum value of objects.
Definition: FFaCheckSum.H:30
Class holding a set of unit conversions for physical properties.
Definition: FFaUnitCalculator.H:28
Definition: FFlAttributeBase.H:26
Definition: FFlFEResultBase.H:13
FE node class. Stores node position and additional data for the node.
Definition: FFlNode.H:39
bool hasDOFs(int dofs=1) const
Definition: FFlNode.H:91
bool hasResults() const
Definition: FFlNode.H:108
char status
Definition: FFlNode.H:113
char myDOFCount
Definition: FFlNode.H:114
bool isSlaveNode() const
Definition: FFlNode.H:82
void setLocalSystem(int ID)
Definition: FFlNode.H:97
bool isAttachable() const
Definition: FFlNode.H:84
bool isRefNode() const
Definition: FFlNode.H:83
FFlNode & operator=(const FFlNode &)=delete
bool isExternal() const
Definition: FFlNode.H:81
bool hasLocalSystem() const
Definition: FFlNode.H:102
FFlFENodeResult * getResults()
FaVec3 & position()
Definition: FFlNode.H:69
FFlFEResultBase * myResults
Definition: FFlNode.H:120
FaVec3 myPos
Definition: FFlNode.H:118
FFlReference< FFlAttributeBase > myLocalSystem
Definition: FFlNode.H:122
const FaVec3 & getPos() const
Definition: FFlNode.H:68
FFL_TYPE_INFO(FFlNode)
void pushDOFs(int dofs)
Definition: FFlNode.H:90
FFlNode * clone() const
Definition: FFlNode.H:48
int getMaxDOFs() const
Definition: FFlNode.H:92
int getStatus(int ignore=0) const
Definition: FFlNode.H:77
Definition: FFlPCOORDSYS.H:22
Base class for all object types of a FE model.
Definition: FFlPartBase.H:27
Definition: FFlVertex.H:24
Class for point vectors in 3D space.
Definition: FFaVec3.H:40
void init()
Definition: FmDB.C:518
@ INTERNAL
Definition: FmFuncAdmin.H:44
@ EXTERNAL
Definition: FmFuncAdmin.H:79