FEDEM Model Database  R8.0
Source code of the FEDEM model database
FFlRGD.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_RGD_H
9 #define FFL_RGD_H
10 
11 #include "FFlLib/FFlElementBase.H"
14 #include "FFlLib/FFlTypeInfoSpec.H"
15 #ifdef FT_USE_MEMPOOL
17 #endif
18 
19 #ifdef FF_NAMESPACE
20 namespace FF_NAMESPACE {
21 #endif
22 
23 
25 {
26 public:
29  virtual ~FFlRGDTopSpec() {}
30 
31  // The master node always has 6 DOFs.
32  // For the slave nodes it depends on the other elements.
33  virtual int getNodeDOFs(int node) const { return node == 1 ? myNodeDOFs : 0; }
34  virtual bool isSlaveNode(int node) const { return node>1 && !allowSlvAttach; }
35 
36  static bool allowSlvAttach; // May be set by command-line handler
37 };
38 
39 
40 class FFlRGD : public FFlElementBase
41 {
42 public:
43  FFlRGD(int ID);
44  FFlRGD(const FFlRGD& obj);
45  virtual ~FFlRGD();
46 
47  static void init();
48 
49  virtual bool setNode(const int topologicalPos, FFlNode* nodeRef);
50  virtual bool setNode(const int topologicalPos, int nodeRef);
51  virtual bool setNodes(const std::vector<int>& nodeIDs,
52  size_t offs, bool shrink = false);
53  virtual bool setNodes(const std::vector<FFlNode*>& nodes,
54  size_t offs, bool shrink = false);
55 
56  void setMasterNode(FFlNode* nodeRef);
57  void setMasterNode(int nodeRef);
58 
59  void addSlaveNode(FFlNode* nodeRef);
60  void addSlaveNode(int nodeRef);
61  void addSlaveNodes(const std::vector<int>& nodeRefs);
62  void addSlaveNodes(const std::vector<FFlNode*>& nodeRefs);
63 
64  FFlNode* getMasterNode() const;
65  void getSlaveNodes(std::vector<FFlNode*>& nodeRefs) const;
66 
67  // returns a unique topology spec for the RGD element
68  virtual FFlFEElementTopSpec* getFEElementTopSpec() const;
69 
73 
74 protected:
76 
77 #ifdef FT_USE_MEMPOOL
79 #endif
80 };
81 
82 #ifdef FF_NAMESPACE
83 } // namespace
84 #endif
85 #endif
Streamlined efficient memory allocation.
#define FFA_MAKE_MEMPOOL
Macro adding memory pool features to a class.
Definition: FFaMemPool.H:139
Definition: FFlElementBase.H:43
Definition: FFlFEElementTopSpec.H:31
FE node class. Stores node position and additional data for the node.
Definition: FFlNode.H:39
Definition: FFlRGD.H:25
FFlRGDTopSpec()
Definition: FFlRGD.H:27
virtual ~FFlRGDTopSpec()
Definition: FFlRGD.H:29
FFlRGDTopSpec(const FFlFEElementTopSpec &obj)
Definition: FFlRGD.H:28
static bool allowSlvAttach
Definition: FFlRGD.H:36
virtual int getNodeDOFs(int node) const
Definition: FFlRGD.H:33
virtual bool isSlaveNode(int node) const
Definition: FFlRGD.H:34
Definition: FFlRGD.H:41
FFL_FE_ATTRIBUTE_SPEC(FFlRGD)
FFL_TYPE_INFO(FFlRGD)
FFlFEElementTopSpec * myRGDElemTopSpec
Definition: FFlRGD.H:75
FFL_FE_ELEMENT_FACTORY_INIT(FFlRGD)
void init()
Definition: FmDB.C:518