FEDEM Model Database  R8.0
Source code of the FEDEM model database
FFlFENodeRefs.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_FE_NODE_REFS_H
9 #define FFL_FE_NODE_REFS_H
10 
11 #include "FFlLib/FFlReference.H"
13 
15 class FFaCheckSum;
16 
17 #ifdef FF_NAMESPACE
18 namespace FF_NAMESPACE {
19 #endif
20 
22 using NodeVec = std::vector<NodeRef>;
23 using NodeCIter = NodeVec::const_iterator;
24 
25 
27 {
28 protected:
29  FFlFENodeRefs() { mySize = 0.0; }
30  FFlFENodeRefs(const FFlFENodeRefs& obj);
32 
33 public:
34  virtual ~FFlFENodeRefs() {}
35 
36  // Get and set nodes on the different element node locations
37 
38  FFlNode* getNode(const int topologicalPos) const;
39  int getNodeID(const int topologicalPos) const;
40  int getTopPos(const int nodeID) const;
41 
42  short int getFaceNum(int node1, int node2) const;
43 
44  int getFaceSize(short int face = 1) const;
45 
46  bool getFaceNodes(std::vector<FFlNode*>& nodes, short int face = 1,
47  bool switchNormal = false) const;
48 
49  virtual bool getFaceNormals(std::vector<FaVec3>&, short int = 1,
50  bool = false) const { return false; }
51 
52  virtual bool setNode(const int topologicalPos, FFlNode* nodeRef);
53  virtual bool setNode(const int topologicalPos, int nodeRef);
54  virtual bool setNodes(const std::vector<int>& nodeRefs,
55  size_t offset = 0, bool = false);
56  virtual bool setNodes(const std::vector<FFlNode*>& nodeRefs,
57  size_t offset = 0, bool = false);
58 
60  bool resolveNodeRefs(const std::vector<FFlNode*>& possibleReferences,
61  bool suppressErrmsg = false);
62 
63  // Access the node container
64 
65  NodeCIter nodesBegin() const { return myNodes.begin(); }
66  NodeCIter nodesEnd() const { return myNodes.end(); }
67  int getNodeCount() const { return myNodes.size(); }
68 
70  FaVec3 getNodeCenter() const;
72  double getSize() const;
73 
76 
78  virtual int getNodalCoor(double* X, double* Y, double* Z) const;
79 
80 private:
81  void initNodeVector() const;
82 
83 protected:
84  void checksum(FFaCheckSum* cs) const;
85 
86  mutable NodeVec myNodes;
87 
88 private:
89  mutable double mySize;
90 };
91 
92 #ifdef FF_NAMESPACE
93 } // namespace
94 #endif
95 #endif
const double const double const double const double double * X
Definition: ChainShape.H:20
const double const double const double const double double double * Y
Definition: ChainShape.H:20
std::vector< NodeRef > NodeVec
Definition: FFlFENodeRefs.H:22
NodeVec::const_iterator NodeCIter
Definition: FFlFENodeRefs.H:23
Class for holding and calculation of checksum value of objects.
Definition: FFaCheckSum.H:30
Definition: FFlFEElementTopSpec.H:31
Definition: FFlFENodeRefs.H:27
virtual bool getFaceNormals(std::vector< FaVec3 > &, short int=1, bool=false) const
Definition: FFlFENodeRefs.H:49
NodeCIter nodesBegin() const
Definition: FFlFENodeRefs.H:65
FFlFENodeRefs()
Definition: FFlFENodeRefs.H:29
virtual FFlFEElementTopSpec * getFEElementTopSpec() const =0
Returns the topological specification of the element.
int getNodeCount() const
Definition: FFlFENodeRefs.H:67
virtual ~FFlFENodeRefs()
Definition: FFlFENodeRefs.H:34
double mySize
Definition: FFlFENodeRefs.H:89
NodeVec myNodes
Definition: FFlFENodeRefs.H:86
NodeCIter nodesEnd() const
Definition: FFlFENodeRefs.H:66
FFlFENodeRefs & operator=(const FFlFENodeRefs &)=delete
FE node class. Stores node position and additional data for the node.
Definition: FFlNode.H:39
Definition: FFlReference.H:27
Class for point vectors in 3D space.
Definition: FFaVec3.H:40