1 | /*! \file Tria.h
|
---|
2 | * \brief: header file for tria object
|
---|
3 | */
|
---|
4 |
|
---|
5 | #ifndef _TRIA_H_
|
---|
6 | #define _TRIA_H_
|
---|
7 |
|
---|
8 | /*Headers:*/
|
---|
9 | /*{{{*/
|
---|
10 | #include "./Element.h"
|
---|
11 | #include "./ElementHook.h"
|
---|
12 | #include "./TriaRef.h"
|
---|
13 | class Parameters;
|
---|
14 | class Inputs;
|
---|
15 | class IoModel;
|
---|
16 | class Results;
|
---|
17 | class Node;
|
---|
18 | class Material;
|
---|
19 | class Matpar;
|
---|
20 | class Seg;
|
---|
21 | class ElementMatrix;
|
---|
22 | class ElementVector;
|
---|
23 | class Vertex;
|
---|
24 | class GaussTria;
|
---|
25 |
|
---|
26 | #include "../../shared/Exceptions/exceptions.h"
|
---|
27 | #include "../../shared/Enum/Enum.h"
|
---|
28 | /*}}}*/
|
---|
29 |
|
---|
30 | class Tria: public Element,public ElementHook,public TriaRef{
|
---|
31 |
|
---|
32 | public:
|
---|
33 |
|
---|
34 | /*Tria constructors, destructors {{{*/
|
---|
35 | Tria(){};
|
---|
36 | Tria(int tria_id,int tria_sid,int i, IoModel* iomodel,int nummodels);
|
---|
37 | ~Tria();
|
---|
38 | /*}}}*/
|
---|
39 | /*Object virtual functions definitions:{{{ */
|
---|
40 | int ObjectEnum();
|
---|
41 | Object *copy();
|
---|
42 | /*}}}*/
|
---|
43 | /*Update virtual functions resolution: {{{*/
|
---|
44 | void InputUpdateFromVector(IssmDouble* vector, int name, int type);
|
---|
45 | #ifdef _HAVE_DAKOTA_
|
---|
46 | void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
|
---|
47 | void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type);
|
---|
48 | #endif
|
---|
49 | void InputUpdateFromIoModel(int index, IoModel* iomodel);
|
---|
50 | /*}}}*/
|
---|
51 | /*Element virtual functions definitions: {{{*/
|
---|
52 | IssmDouble CharacteristicLength(void);
|
---|
53 | void ComputeBasalStress(Vector<IssmDouble>* sigma_b);
|
---|
54 | void ComputeSigmaNN();
|
---|
55 | void ComputeStrainRate(Vector<IssmDouble>* eps);
|
---|
56 | void ComputeStressTensor();
|
---|
57 | void ComputeDeviatoricStressTensor();
|
---|
58 | void ComputeSurfaceNormalVelocity();
|
---|
59 | void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
|
---|
60 | void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
|
---|
61 | void Delta18oParameterization(void);
|
---|
62 | void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
|
---|
63 | void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating);
|
---|
64 | int FiniteElement(void);
|
---|
65 | Element* GetUpperElement(void){_error_("not implemented yet");};
|
---|
66 | Element* GetLowerElement(void){_error_("not implemented yet");};
|
---|
67 | Element* GetSurfaceElement(void){_error_("not implemented yet");};
|
---|
68 | Element* GetBasalElement(void){_error_("not implemented yet");};
|
---|
69 | void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
|
---|
70 | IssmDouble GetGroundedPortion(IssmDouble* xyz_list);
|
---|
71 | int GetNodeIndex(Node* node);
|
---|
72 | int GetNumberOfNodes(void);
|
---|
73 | int GetNumberOfVertices(void);
|
---|
74 | bool IsOnBase();
|
---|
75 | bool IsOnSurface();
|
---|
76 | bool HasEdgeOnBase();
|
---|
77 | bool HasEdgeOnSurface();
|
---|
78 | void EdgeOnSurfaceIndices(int* pindex1,int* pindex);
|
---|
79 | void EdgeOnBaseIndices(int* pindex1,int* pindex);
|
---|
80 | int EdgeOnBaseIndex();
|
---|
81 | int EdgeOnSurfaceIndex();
|
---|
82 | bool IsNodeOnShelfFromFlags(IssmDouble* flags);
|
---|
83 | int NumberofNodesVelocity(void);
|
---|
84 | int NumberofNodesPressure(void);
|
---|
85 | void GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type);
|
---|
86 | void GetVerticesCoordinatesBase(IssmDouble** pxyz_list);
|
---|
87 | void GetVerticesCoordinatesTop(IssmDouble** pxyz_list);
|
---|
88 | void InputDepthAverageAtBase(int enum_type,int average_enum_type);
|
---|
89 | void InputDuplicate(int original_enum,int new_enum);
|
---|
90 | void InputScale(int enum_type,IssmDouble scale_factor);
|
---|
91 | void MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
|
---|
92 | int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum);
|
---|
93 | void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
|
---|
94 | void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
|
---|
95 | void ResetFSBasalBoundaryCondition(void);
|
---|
96 | void SmbGradients();
|
---|
97 | Element* SpawnBasalElement(void);
|
---|
98 | Element* SpawnTopElement(void);
|
---|
99 | int VelocityInterpolation();
|
---|
100 | int PressureInterpolation();
|
---|
101 | IssmDouble SurfaceArea(void);
|
---|
102 | void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement);
|
---|
103 | IssmDouble TimeAdapt();
|
---|
104 | void ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss);
|
---|
105 | void ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss);
|
---|
106 | int VertexConnectivity(int vertexindex);
|
---|
107 | void VerticalSegmentIndices(int** pindices,int* pnumseg){_error_("not implemented yet");};
|
---|
108 | void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum);
|
---|
109 | void GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
|
---|
110 | void GetNormalFromLSF(IssmDouble *pnormal);
|
---|
111 | bool IsZeroLevelset(int levelset_enum);
|
---|
112 | bool IsIcefront(void);
|
---|
113 |
|
---|
114 | void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
|
---|
115 | IssmDouble IceVolume(void);
|
---|
116 | IssmDouble IceVolumeAboveFloatation(void);
|
---|
117 | IssmDouble TotalSmb(void);
|
---|
118 | void MinVel(IssmDouble* pminvel);
|
---|
119 | void MinVx(IssmDouble* pminvx);
|
---|
120 | void MinVy(IssmDouble* pminvy);
|
---|
121 | void MinVz(IssmDouble* pminvz);
|
---|
122 | IssmDouble MassFlux(IssmDouble* segment);
|
---|
123 | IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
|
---|
124 | void MaxAbsVx(IssmDouble* pmaxabsvx);
|
---|
125 | void MaxAbsVy(IssmDouble* pmaxabsvy);
|
---|
126 | void MaxAbsVz(IssmDouble* pmaxabsvz);
|
---|
127 | void ElementResponse(IssmDouble* presponse,int response_enum);
|
---|
128 | void MaxVel(IssmDouble* pmaxvel);
|
---|
129 | void MaxVx(IssmDouble* pmaxvx);
|
---|
130 | void MaxVy(IssmDouble* pmaxvy);
|
---|
131 | void MaxVz(IssmDouble* pmaxvz);
|
---|
132 | IssmDouble Misfit(int modelenum,int observationenum,int weightsenum);
|
---|
133 | IssmDouble MisfitArea(int weightsenum);
|
---|
134 |
|
---|
135 | #ifdef _HAVE_GIA_
|
---|
136 | void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
|
---|
137 | #endif
|
---|
138 |
|
---|
139 | IssmDouble DragCoefficientAbsGradient(void);
|
---|
140 | void GradientIndexing(int* indexing,int control_index);
|
---|
141 | void Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
|
---|
142 | void GradjBGradient(Vector<IssmDouble>* gradient,int control_index);
|
---|
143 | void GradjDGradient(Vector<IssmDouble>* gradient,int control_index);
|
---|
144 | void GradjBSSA(Vector<IssmDouble>* gradient,int control_index);
|
---|
145 | void GradjDSSA(Vector<IssmDouble>* gradient,int control_index);
|
---|
146 | void GradjDragSSA(Vector<IssmDouble>* gradient,int control_index);
|
---|
147 | void GradjDragFS(Vector<IssmDouble>* gradient,int control_index);
|
---|
148 | void GradjDragGradient(Vector<IssmDouble>* gradient,int control_index);
|
---|
149 | void GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
|
---|
150 | void GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
|
---|
151 | void GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
|
---|
152 | void GradjThicknessBalancethicknessSoft(Vector<IssmDouble>* gradient,int control_index);
|
---|
153 | void GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
|
---|
154 | void SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
|
---|
155 | void ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
|
---|
156 | void ControlInputScaleGradient(int enum_type,IssmDouble scale);
|
---|
157 | void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
|
---|
158 | void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum);
|
---|
159 | IssmDouble RheologyBbarAbsGradient(void);
|
---|
160 | IssmDouble ThicknessAbsMisfit(void);
|
---|
161 | IssmDouble SurfaceAbsVelMisfit(void);
|
---|
162 | IssmDouble ThicknessAbsGradient(void);
|
---|
163 | IssmDouble ThicknessAlongGradient(void);
|
---|
164 | IssmDouble ThicknessAcrossGradient(void);
|
---|
165 | IssmDouble BalancethicknessMisfit(void);
|
---|
166 | IssmDouble SurfaceRelVelMisfit(void);
|
---|
167 | IssmDouble SurfaceLogVelMisfit(void);
|
---|
168 | IssmDouble SurfaceLogVxVyMisfit(void);
|
---|
169 | IssmDouble SurfaceAverageVelMisfit(void);
|
---|
170 | void InputControlUpdate(IssmDouble scalar,bool save_parameter);
|
---|
171 |
|
---|
172 | void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
|
---|
173 | void MigrateGroundingLine(IssmDouble* sheet_ungrounding);
|
---|
174 | int UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
|
---|
175 |
|
---|
176 | /*}}}*/
|
---|
177 | /*Tria specific routines:{{{*/
|
---|
178 | void AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum);
|
---|
179 | void AddInput(int input_enum, IssmDouble* values, int interpolation_enum);
|
---|
180 | IssmDouble GetArea(void);
|
---|
181 | void GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints);
|
---|
182 | int GetElementType(void);
|
---|
183 | IssmDouble GetXcoord(Gauss* gauss);
|
---|
184 | IssmDouble GetYcoord(Gauss* gauss);
|
---|
185 | IssmDouble GetZcoord(Gauss* gauss){_error_("not implemented");};
|
---|
186 | void NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
187 | void NormalTop(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
188 | void NormalBase(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
189 | void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
|
---|
190 | void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype);
|
---|
191 | Node* GetNode(int node_number);
|
---|
192 | void InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type);
|
---|
193 | void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int enum_type){_error_("not implemented yet");};
|
---|
194 | void JacobianDeterminant(IssmDouble* pJdet, IssmDouble* xyz_list,Gauss* gauss);
|
---|
195 | void JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
|
---|
196 | void JacobianDeterminantSurface(IssmDouble* pJdet, IssmDouble* xyz_list,Gauss* gauss);
|
---|
197 | void JacobianDeterminantBase(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
|
---|
198 | void JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
|
---|
199 | IssmDouble MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
|
---|
200 | Gauss* NewGauss(void);
|
---|
201 | Gauss* NewGauss(int order);
|
---|
202 | Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
|
---|
203 | Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
|
---|
204 | Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
|
---|
205 | Gauss* NewGaussBase(int order);
|
---|
206 | Gauss* NewGaussLine(int vertex1,int vertex2,int order){_error_("not implemented yet");};
|
---|
207 | Gauss* NewGaussTop(int order);
|
---|
208 | void NodalFunctions(IssmDouble* basis,Gauss* gauss);
|
---|
209 | void NodalFunctionsP1(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
|
---|
210 | void NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
211 | void NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
|
---|
212 | void NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
|
---|
213 | void NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
214 | void NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss);
|
---|
215 | void NodalFunctionsPressure(IssmDouble* basis,Gauss* gauss);
|
---|
216 | void NodalFunctionsTensor(IssmDouble* basis,Gauss* gauss);
|
---|
217 | void SetClone(int* minranks);
|
---|
218 | void SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
|
---|
219 | Seg* SpawnSeg(int index1,int index2);
|
---|
220 | IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
|
---|
221 | void ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented yet");};
|
---|
222 |
|
---|
223 | void UpdateConstraintsExtrudeFromBase(void);
|
---|
224 | void UpdateConstraintsExtrudeFromTop(void);
|
---|
225 |
|
---|
226 | void CreateHydrologyWaterVelocityInput(void);
|
---|
227 | /*}}}*/
|
---|
228 |
|
---|
229 | };
|
---|
230 | #endif /* _TRIA_H */
|
---|