source: issm/trunk-jpl/src/c/classes/objects/Node.h@ 13216

Last change on this file since 13216 was 13216, checked in by Eric.Larour, 13 years ago

NEW: large change to the code, to adapt to ADOLC requirements.

This change relates to the introduction of template classes and functions for the
Option.h abstract class. This is needed, because we want to make the Matlab
API independent from the libCore objects, which are dependent on the IssmDouble*
ADOLC type (adouble), when the Matlab API is dependent on the IssmPDouble* type (double).

To make them independent, we need to be able to specify at run time Options, Matrix and
Vector objects that hold either IssmDouble or IssmPDouble objects. The only way to do
that is through the use of templated classes for Option.h, Matrix and Vector.

The change gets rid of a lot of useless code (especially in the classes/objects/Options
directory), by introducing template versions of the same code.

The bulk of the changes to src/modules and src/mex modules is to adapt to this
new runtime declaration of templated Matrix, Vector and Option objects.

File size: 3.9 KB
Line 
1/*!\file Node.h
2 * \brief: header file for node object
3 */
4
5#ifndef _NODE_H_
6#define _NODE_H_
7
8/*Headers:*/
9/*{{{*/
10#include "./Object.h"
11#include "../../shared/shared.h"
12#include "../DofIndexing.h"
13class Inputs;
14class Hook;
15class IoModel;
16class DataSet;
17class Vertices;
18template <class doubletype> class Vector;
19template <class doubletype> class Matrix;
20#include "../Update.h"
21/*}}}*/
22
23class Node: public Object ,public Update{
24
25 public:
26
27 int id; //unique arbitrary id.
28 int sid; //sid for "serial" id, ie the rank of this node in the nodes dataset, if the dataset was serial on 1 cpu.
29
30 DofIndexing indexing;
31 Hook* hvertex;
32 Inputs* inputs; //properties of this node
33 int analysis_type;
34 IssmDouble coord_system[3][3];
35
36 /*Node constructors, destructors {{{*/
37 Node();
38 Node(int node_id,int node_sid, int vertex_id,int io_index, IoModel* iomodel,int analysis_type);
39 ~Node();
40 /*}}}*/
41 /*Object virtual functions definitions:{{{ */
42 void Echo();
43 void DeepEcho();
44 int Id();
45 int MyRank();
46 int ObjectEnum();
47 Object* copy(){_error_("Not implemented yet (similar to Elements)");};
48 /*}}}*/
49 /*Update virtual functions definitions: {{{*/
50
51 void InputUpdateFromVector(IssmDouble* vector, int name, int type);
52 void InputUpdateFromVector(int* vector, int name, int type);
53 void InputUpdateFromVector(bool* vector, int name, int type);
54 void InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows, int ncols, int name, int type);
55 void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
56 void InputUpdateFromVectorDakota(int* vector, int name, int type);
57 void InputUpdateFromVectorDakota(bool* vector, int name, int type);
58 void InputUpdateFromConstant(IssmDouble constant, int name);
59 void InputUpdateFromConstant(int constant, int name);
60 void InputUpdateFromConstant(bool constant, int name);
61 void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
62 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("Not implemented yet!");}
63 /*}}}*/
64 /*Node numerical routines {{{*/
65 void Configure(DataSet* nodes,Vertices* vertices);
66 void CreateNodalConstraints(Vector<IssmDouble>* ys);
67 void SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
68 int Sid(void);
69 int GetVertexDof(void);
70 int GetVertexId(void);
71#ifdef _HAVE_DIAGNOSTIC_
72 void GetCoordinateSystem(IssmDouble* coord_system_out);
73#endif
74 void SetVertexDof(int in_dof);
75 bool InAnalysis(int analysis_type);
76 int GetApproximation();
77 int GetNumberOfDofs(int approximation_enum,int setenum);
78 int IsClone();
79 void ApplyConstraint(int dof,IssmDouble value);
80 void RelaxConstraint(int dof);
81 void DofInSSet(int dof);
82 void DofInFSet(int dof);
83 int GetDof(int dofindex,int setenum);
84 void CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s);
85 int GetConnectivity();
86 void GetDofList(int* poutdoflist,int approximation_enum,int setenum);
87 void GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
88 int GetDofList1(void);
89 int GetSidList(void);
90 IssmDouble GetX();
91 IssmDouble GetY();
92 IssmDouble GetZ();
93 IssmDouble GetSigma();
94 int IsOnBed();
95 int IsOnSurface();
96 void FreezeDof(int dof);
97 int IsFloating();
98 int IsGrounded();
99 void UpdateSpcs(IssmDouble* ys);
100 void VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum);
101 void VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum);
102
103 /*}}}*/
104 /*Dof Object routines {{{*/
105 void DistributeDofs(int* pdofcount,int setenum);
106 void OffsetDofs(int dofcount,int setenum);
107 void ShowTrueDofs(int* truerows,int ncols,int setenum);
108 void UpdateCloneDofs(int* alltruerows,int ncols,int setenum);
109 void SetClone(int* minranks);
110 /*}}}*/
111};
112
113#endif /* _NODE_H_ */
Note: See TracBrowser for help on using the repository browser.