Ice Sheet System Model  4.18
Code documentation
Node.h
Go to the documentation of this file.
1 
5 #ifndef _NODE_H_
6 #define _NODE_H_
7 
8 /*Headers:*/
9 /*{{{*/
10 #include "../datastructures/datastructures.h"
11 #include "../shared/shared.h"
12 class Inputs;
13 class Hook;
14 class IoModel;
15 class DataSet;
16 class Vertices;
17 template <class doubletype> class Vector;
18 template <class doubletype> class Matrix;
19 class ElementVector;
20 class ElementMatrix;
21 /*}}}*/
22 
23 class Node: public Object{
24 
25  private:
26  int approximation; //For ice flow models, we need to know what ice flow approximation is employed on this node
27  bool clone; //this node is replicated from another one
28  int id; // unique arbitrary id.
29  int sid; // "serial" id (rank of this node if the dataset was serial on 1 cpu)
30  int lid; // "local" id (rank of this node in current partition)
31  int pid; // parallel id (specific to this partition)
32 
33  /*Only this function can access these private fields*/
34  //friend void Nodes::Finalize();
35  friend class Nodes;
36  friend class FemModel;
37 
38  public:
42 
43  /*sizes: */
44  int gsize; //number of dofs for a node
45  int fsize; //number of dofs solver for
46  int ssize; //number of constrained dofs
47 
48  /*Activation*/
49  bool active; //Is this node active or inactive (all dofs are constrained)
50  bool freeze; //this is required for 2d solutions, we never activate nodes that are not on base
51 
52  /*boundary conditions sets: */
53  bool *f_set; //is dof on f-set (on which we solve)
54  bool *s_set; //is dof on s-set (on which boundary conditions -dirichlet- are applied)
55  IssmDouble *svalues; //list of constraint values. size g_size, for ease of use.
56 
57  /*types of dofs: */
58  int *doftype; //approximation type of the dofs (used only for coupling), size g_size
59 
60  /*list of degrees of freedom: */
61  int *gdoflist;
62  int *fdoflist;
63  int *sdoflist;
67 
68  /*Node constructors, destructors*/
69  Node();
70  Node(int node_id,int node_sid,int io_index,bool isclone,IoModel* iomodel,int analysis_enum,int approximation_in,bool isamr);
71  ~Node();
72 
73  /*Object virtual functions definitions:*/
74  Object *copy();
75  void DeepEcho();
76  void Echo();
77  int Id();
78  void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
79  int ObjectEnum();
80 
81  /*Node numerical routines*/
82  void AllocateDofLists(int setenum);
83  void Activate(void);
84  void ApplyConstraint(int dof,IssmDouble value);
86  void Deactivate(void);
87  void DistributeLocalDofs(int* pdofcount,int setenum);
88  void DofInFSet(int dof);
89  void DofInSSet(int dof);
90  void FreezeDof(int dof);
91  int GetApproximation();
92  void GetCoordinateSystem(IssmDouble* coord_system_out);
93  int GetDof(int dofindex,int setenum);
94  void GetDofList(int* poutdoflist,int approximation_enum,int setenum);
95  void GetDofListLocal(int* poutdoflist,int approximation_enum,int setenum);
96  void GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
97  int GetNumberOfDofs(int approximation_enum,int setenum);
98  void HardDeactivate(void);
99  bool IsActive(void);
100  int IsClone();
101  int IsFloating();
102  int IsGrounded();
103  int Lid(void);
104  void DistributeGlobalDofsMasters(int dofcount,int setenum);
105  void ReindexingDone(void);
106  void RelaxConstraint(int dof);
107  bool RequiresDofReindexing(void);
109  void ShowMasterDofs(int* truerows,int setenum);
110  int Sid(void);
111  int Pid(void);
112  void UpdateCloneDofs(int* alltruerows,int setenum);
113  void VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,IssmDouble* local_ys,int* indices_ys);
114  void VecReduce(Vector<IssmDouble>* uf, IssmDouble* local_ug,int* indices_ug);
115  void SetApproximation(int in_approximation);
116 };
117 
118 /*Methods inherent to Node: */
119 int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation);
120 int* GetLocalDofList(Node** nodes,int numnodes,int setenum,int approximation);
121 int GetNumberOfDofs(Node** nodes,int numnodes,int setenum,int approximation);
122 
123 #endif /* _NODE_H_ */
Matrix
Definition: Matrix.h:27
Node::id
int id
Definition: Node.h:28
Node::IsActive
bool IsActive(void)
Definition: Node.cpp:795
GetNumberOfDofs
int GetNumberOfDofs(Node **nodes, int numnodes, int setenum, int approximation)
Definition: Node.cpp:1129
Node::UpdateCloneDofs
void UpdateCloneDofs(int *alltruerows, int setenum)
Definition: Node.cpp:1012
Vertices
Declaration of Vertices class.
Definition: Vertices.h:15
FemModel::vertices
Vertices * vertices
Definition: FemModel.h:49
IssmDouble
double IssmDouble
Definition: types.h:37
Nodes
Declaration of Nodes class.
Definition: Nodes.h:19
GetLocalDofList
int * GetLocalDofList(Node **nodes, int numnodes, int setenum, int approximation)
Definition: Node.cpp:1072
Node::GetLocalDofList
void GetLocalDofList(int *poutdoflist, int approximation_enum, int setenum)
Definition: Node.cpp:518
Node::sdoflist_local
int * sdoflist_local
Definition: Node.h:66
Node::GetDofListLocal
void GetDofListLocal(int *poutdoflist, int approximation_enum, int setenum)
Definition: Node.cpp:455
Node::svalues
IssmDouble * svalues
Definition: Node.h:55
Node::GetApproximation
int GetApproximation()
Definition: Node.cpp:731
Node::IsGrounded
int IsGrounded()
Node::DistributeLocalDofs
void DistributeLocalDofs(int *pdofcount, int setenum)
Definition: Node.cpp:943
Node::indexingupdate
bool indexingupdate
Definition: Node.h:41
Node::clone
bool clone
Definition: Node.h:27
Node::freeze
bool freeze
Definition: Node.h:50
Node::sid
int sid
Definition: Node.h:29
Node::DistributeGlobalDofsMasters
void DistributeGlobalDofsMasters(int dofcount, int setenum)
Definition: Node.cpp:970
Node::active
bool active
Definition: Node.h:49
GetGlobalDofList
int * GetGlobalDofList(Node **nodes, int numnodes, int setenum, int approximation)
Definition: Node.cpp:1035
Node::ssize
int ssize
Definition: Node.h:46
Node::s_set
bool * s_set
Definition: Node.h:54
Node::RelaxConstraint
void RelaxConstraint(int dof)
Definition: Node.cpp:813
Object
Definition: Object.h:13
Node::Id
int Id()
Definition: Node.cpp:357
Node::analysis_enum
int analysis_enum
Definition: Node.h:39
Node::SetApproximation
void SetApproximation(int in_approximation)
Definition: Node.cpp:736
FemModel::nodes
Nodes * nodes
Definition: FemModel.h:56
Node::doftype
int * doftype
Definition: Node.h:58
Node::HardDeactivate
void HardDeactivate(void)
Definition: Node.cpp:788
Node::IsFloating
int IsFloating()
Node::ReindexingDone
void ReindexingDone(void)
Definition: Node.cpp:807
Hook
Definition: Hook.h:16
Node::pid
int pid
Definition: Node.h:31
Node::sdoflist
int * sdoflist
Definition: Node.h:63
Node::VecReduce
void VecReduce(Vector< IssmDouble > *uf, IssmDouble *local_ug, int *indices_ug)
Definition: Node.cpp:875
Node::IsClone
int IsClone()
Definition: Node.cpp:801
Node::AllocateDofLists
void AllocateDofLists(int setenum)
Definition: Node.cpp:905
Node::GetDofList
void GetDofList(int *poutdoflist, int approximation_enum, int setenum)
Definition: Node.cpp:392
FemModel
Definition: FemModel.h:31
Node::ObjectEnum
int ObjectEnum()
Definition: Node.cpp:359
Node::coord_system
IssmDouble coord_system[3][3]
Definition: Node.h:40
Node::Marshall
void Marshall(char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
Definition: Node.cpp:251
Node::Echo
void Echo()
Definition: Node.cpp:339
Node
Definition: Node.h:23
Node::Lid
int Lid(void)
Definition: Node.cpp:618
Node::Sid
int Sid(void)
Definition: Node.cpp:622
Node::approximation
int approximation
Definition: Node.h:26
Node::Deactivate
void Deactivate(void)
Definition: Node.cpp:681
Node::DofInFSet
void DofInFSet(int dof)
Definition: Node.cpp:694
Node::DofInSSet
void DofInSSet(int dof)
Definition: Node.cpp:709
Node::GetCoordinateSystem
void GetCoordinateSystem(IssmDouble *coord_system_out)
Definition: Node.cpp:367
Node::VecMerge
void VecMerge(Vector< IssmDouble > *ug, IssmDouble *local_uf, int *indices_uf, IssmDouble *local_ys, int *indices_ys)
Definition: Node.cpp:828
Node::Node
Node()
Definition: Node.cpp:19
Node::f_set
bool * f_set
Definition: Node.h:53
Node::lid
int lid
Definition: Node.h:30
Node::gsize
int gsize
Definition: Node.h:44
Node::gdoflist_local
int * gdoflist_local
Definition: Node.h:64
Node::FreezeDof
void FreezeDof(int dof)
Definition: Node.cpp:723
Node::ApplyConstraint
void ApplyConstraint(int dof, IssmDouble value)
Definition: Node.cpp:646
ElementVector
Definition: ElementVector.h:20
IoModel
Definition: IoModel.h:48
Node::fdoflist_local
int * fdoflist_local
Definition: Node.h:65
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
Node::CreateNodalConstraints
void CreateNodalConstraints(Vector< IssmDouble > *ys)
Definition: Node.cpp:654
Node::fdoflist
int * fdoflist
Definition: Node.h:62
Node::gdoflist
int * gdoflist
Definition: Node.h:61
ElementMatrix
Definition: ElementMatrix.h:19
Vector
Definition: Vector.h:25
Node::GetNumberOfDofs
int GetNumberOfDofs(int approximation_enum, int setenum)
Definition: Node.cpp:741
Node::Pid
int Pid(void)
Definition: Node.cpp:626
Node::RequiresDofReindexing
bool RequiresDofReindexing(void)
Definition: Node.cpp:822
Node::SetCurrentConfiguration
void SetCurrentConfiguration(DataSet *nodes, Vertices *vertices)
Node::fsize
int fsize
Definition: Node.h:45
Node::ShowMasterDofs
void ShowMasterDofs(int *truerows, int setenum)
Definition: Node.cpp:991
Node::DeepEcho
void DeepEcho()
Definition: Node.cpp:281
Node::~Node
~Node()
Definition: Node.cpp:172
Node::GetDof
int GetDof(int dofindex, int setenum)
Definition: Node.cpp:374
Node::Activate
void Activate(void)
Definition: Node.cpp:632
Node::copy
Object * copy()
Definition: Node.cpp:187