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 Seg;
|
---|
20 | class ElementMatrix;
|
---|
21 | class ElementVector;
|
---|
22 | class Vertex;
|
---|
23 | class GaussTria;
|
---|
24 |
|
---|
25 | #include "../../shared/Exceptions/exceptions.h"
|
---|
26 | #include "../../shared/Enum/Enum.h"
|
---|
27 | /*}}}*/
|
---|
28 |
|
---|
29 | class Tria: public Element,public ElementHook,public TriaRef{
|
---|
30 |
|
---|
31 | public:
|
---|
32 | int iscollapsed;
|
---|
33 |
|
---|
34 | /*Tria constructors, destructors {{{*/
|
---|
35 | Tria(){};
|
---|
36 | Tria(int tria_id,int tria_sid,int tria_lid,IoModel* iomodel,int nummodels);
|
---|
37 | ~Tria();
|
---|
38 | /*}}}*/
|
---|
39 | /*Object virtual functions definitions:{{{ */
|
---|
40 | Object *copy();
|
---|
41 | void Marshall(MarshallHandle* marshallhandle);
|
---|
42 | int ObjectEnum();
|
---|
43 | /*}}}*/
|
---|
44 | /*Update virtual functions resolution: {{{*/
|
---|
45 | #ifdef _HAVE_DAKOTA_
|
---|
46 | void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type);
|
---|
47 | void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
|
---|
48 | void InputScaleFromDakota(IssmDouble* distributed_values, IssmDouble* partition, int npart, int nt, int name);
|
---|
49 | #endif
|
---|
50 | void InputUpdateFromIoModel(int index, IoModel* iomodel);
|
---|
51 | void InputUpdateFromVector(IssmDouble* vector, int name, int type);
|
---|
52 | /*}}}*/
|
---|
53 | /*Element virtual functions definitions: {{{*/
|
---|
54 | void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
|
---|
55 | void CalvingRateVonmises();
|
---|
56 | void CalvingCrevasseDepth();
|
---|
57 | void CalvingRateLevermann();
|
---|
58 | void CalvingFluxLevelset();
|
---|
59 | void CalvingMeltingFluxLevelset();
|
---|
60 | IssmDouble CharacteristicLength(void);
|
---|
61 | void ComputeBasalStress(void);
|
---|
62 | void ComputeDeviatoricStressTensor();
|
---|
63 | void ComputeEsaStrainAndVorticity();
|
---|
64 | void ComputeSigmaNN();
|
---|
65 | void ComputeStressTensor();
|
---|
66 | void ComputeSurfaceNormalVelocity();
|
---|
67 | void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters,Inputs* inputsin);
|
---|
68 | void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int M,int N,int interp);
|
---|
69 | void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp);
|
---|
70 | void CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
|
---|
71 | int EdgeOnBaseIndex();
|
---|
72 | void EdgeOnBaseIndices(int* pindex1,int* pindex);
|
---|
73 | int EdgeOnSurfaceIndex();
|
---|
74 | void EdgeOnSurfaceIndices(int* pindex1,int* pindex);
|
---|
75 | void ElementResponse(IssmDouble* presponse,int response_enum);
|
---|
76 | void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
|
---|
77 | int FiniteElement(void);
|
---|
78 | IssmDouble FloatingArea(bool scaled);
|
---|
79 | void FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure);
|
---|
80 | Element* GetBasalElement(void){_error_("not implemented yet");};
|
---|
81 | void GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues);
|
---|
82 | void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
|
---|
83 | IssmDouble GetGroundedPortion(IssmDouble* xyz_list);
|
---|
84 | IssmDouble GetIcefrontArea();
|
---|
85 | void GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
|
---|
86 | void GetInputListOnVertices(IssmDouble* pvalue,Input* input,IssmDouble default_value);
|
---|
87 | void GetInputListOnNodes(IssmDouble* pvalue,Input* input,IssmDouble default_value);
|
---|
88 | void GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level);
|
---|
89 | int GetVertexIndex(Vertex* vertex);
|
---|
90 | int GetNumberOfNodes(void);
|
---|
91 | int GetNumberOfNodes(int enum_type);
|
---|
92 | int GetNumberOfVertices(void);
|
---|
93 | void GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,int N,const char* data,int offset);
|
---|
94 | void GetVerticesCoordinatesBase(IssmDouble** pxyz_list);
|
---|
95 | void GetVerticesCoordinatesTop(IssmDouble** pxyz_list);
|
---|
96 | IssmDouble GroundedArea(bool scaled);
|
---|
97 | bool HasEdgeOnBase();
|
---|
98 | bool HasEdgeOnSurface();
|
---|
99 | IssmDouble IceVolume(bool scaled);
|
---|
100 | IssmDouble IceVolumeAboveFloatation(bool scaled);
|
---|
101 | IssmDouble IcefrontMassFlux(bool scaled);
|
---|
102 | IssmDouble IcefrontMassFluxLevelset(bool scaled);
|
---|
103 | IssmDouble GroundinglineMassFlux(bool scaled);
|
---|
104 | void InputDepthAverageAtBase(int enum_type,int average_enum_type);
|
---|
105 | void InputExtrude(int enum_type,int start){_error_("not implemented"); /*For penta only*/};
|
---|
106 | void ControlInputExtrude(int enum_type,int start){/*For penta only*/};
|
---|
107 | bool IsFaceOnBoundary(void);
|
---|
108 | bool IsIcefront(void);
|
---|
109 | bool IsNodeOnShelfFromFlags(IssmDouble* flags);
|
---|
110 | bool IsZeroLevelset(int levelset_enum);
|
---|
111 | IssmDouble Masscon(IssmDouble* levelset);
|
---|
112 | IssmDouble MassFlux(IssmDouble* segment);
|
---|
113 | IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
|
---|
114 | void MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
|
---|
115 | IssmDouble Misfit(int modelenum,int observationenum,int weightsenum);
|
---|
116 | IssmDouble MisfitArea(int weightsenum);
|
---|
117 | int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum);
|
---|
118 | int NumberofNodesPressure(void);
|
---|
119 | int NumberofNodesVelocity(void);
|
---|
120 | void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
|
---|
121 | int PressureInterpolation();
|
---|
122 | void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
|
---|
123 | void ResetFSBasalBoundaryCondition(void);
|
---|
124 | void ResetHooks();
|
---|
125 | void ResetLevelsetFromSegmentlist(IssmDouble* segments,int numsegments);
|
---|
126 | void RignotMeltParameterization();
|
---|
127 | void SetElementInput(int enum_in,IssmDouble values);
|
---|
128 | void SetElementInput(Inputs* inputs,int enum_in,IssmDouble values);
|
---|
129 | void SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in);
|
---|
130 | void SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M,int N);
|
---|
131 | void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
|
---|
132 | Element* SpawnBasalElement(bool depthaverage_materials);
|
---|
133 | Element* SpawnTopElement(void);
|
---|
134 | void StrainRateparallel();
|
---|
135 | void StrainRateperpendicular();
|
---|
136 | void StressIntensityFactor(void){_error_("not implemented yet");};
|
---|
137 | IssmDouble SurfaceArea(void);
|
---|
138 | int TensorInterpolation();
|
---|
139 | IssmDouble TimeAdapt();
|
---|
140 | IssmDouble TotalCalvingFluxLevelset(bool scaled);
|
---|
141 | IssmDouble TotalCalvingMeltingFluxLevelset(bool scaled);
|
---|
142 | IssmDouble TotalFloatingBmb(bool scaled);
|
---|
143 | IssmDouble TotalGroundedBmb(bool scaled);
|
---|
144 | IssmDouble TotalSmb(bool scaled);
|
---|
145 | void Update(Inputs* inputs,int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement);
|
---|
146 | int UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
|
---|
147 | void ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss);
|
---|
148 | void ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss);
|
---|
149 | int VelocityInterpolation();
|
---|
150 | int VertexConnectivity(int vertexindex);
|
---|
151 | void VerticalSegmentIndices(int** pindices,int* pnumseg){_error_("not implemented yet");};
|
---|
152 | void VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");};
|
---|
153 | void WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue);
|
---|
154 |
|
---|
155 | #ifdef _HAVE_GIA_
|
---|
156 | void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
|
---|
157 | #endif
|
---|
158 | #ifdef _HAVE_ESA_
|
---|
159 | void EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy);
|
---|
160 | void EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz);
|
---|
161 | #endif
|
---|
162 | #ifdef _HAVE_SEALEVELRISE_
|
---|
163 | IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks);
|
---|
164 | void SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
|
---|
165 | void SetSealevelMasks(SealevelMasks* masks);
|
---|
166 | void SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
|
---|
167 | IssmDouble SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
|
---|
168 | IssmDouble SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
|
---|
169 | void SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
|
---|
170 | void SealevelriseNonEustatic(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
|
---|
171 | void SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
|
---|
172 | #endif
|
---|
173 | /*}}}*/
|
---|
174 | /*Tria specific routines:{{{*/
|
---|
175 | void AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum);
|
---|
176 | void AddInput(int input_enum, IssmDouble* values, int interpolation_enum);
|
---|
177 | void AddControlInput(int input_enum,Inputs* inputs,IoModel* iomodel,IssmDouble* values,IssmDouble* values_min,IssmDouble* values_max, int interpolation_enum,int id);
|
---|
178 | void DatasetInputCreate(IssmDouble* array,int M,int N,int* individual_enums,int num_inputs,Inputs* inputs,IoModel* iomodel,int input_enum);
|
---|
179 | void CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble init_time,IssmDouble end_time,int averaging_method);
|
---|
180 | void GetInputAveragesUpToCurrentTime(int input_enum,IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
|
---|
181 | IssmDouble GetArea(void);
|
---|
182 | IssmDouble GetHorizontalSurfaceArea(void);
|
---|
183 | IssmDouble GetArea3D(void);
|
---|
184 | IssmDouble GetAreaIce(void);
|
---|
185 | IssmDouble GetAreaSpherical(void);
|
---|
186 | void GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints);
|
---|
187 | int GetElementType(void);
|
---|
188 | Input* GetInput(int enumtype);
|
---|
189 | Input* GetInput(int enumtype,IssmDouble time);
|
---|
190 | Input* GetInput(int inputenum,IssmDouble start_time,IssmDouble end_time,int averaging_method);
|
---|
191 | DatasetInput* GetDatasetInput(int inputenum);
|
---|
192 | void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
|
---|
193 | void GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype);
|
---|
194 | void GetLevelsetIntersection(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level);
|
---|
195 | void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype);
|
---|
196 | void InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type);
|
---|
197 | void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int enum_type){_error_("not implemented yet");};
|
---|
198 | void JacobianDeterminant(IssmDouble* pJdet, IssmDouble* xyz_list,Gauss* gauss);
|
---|
199 | void JacobianDeterminantBase(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
|
---|
200 | void JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
|
---|
201 | void JacobianDeterminantSurface(IssmDouble* pJdet, IssmDouble* xyz_list,Gauss* gauss);
|
---|
202 | void JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
|
---|
203 | IssmDouble MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
|
---|
204 | Gauss* NewGauss(void);
|
---|
205 | Gauss* NewGauss(int order);
|
---|
206 | Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
|
---|
207 | Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
|
---|
208 | Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,int order);
|
---|
209 | Gauss* NewGauss(IssmDouble fraction1,IssmDouble fraction2,int order);
|
---|
210 | Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
|
---|
211 | Gauss* NewGaussBase(int order);
|
---|
212 | Gauss* NewGaussLine(int vertex1,int vertex2,int order){_error_("not implemented yet");};
|
---|
213 | Gauss* NewGaussTop(int order);
|
---|
214 | void NodalFunctions(IssmDouble* basis,Gauss* gauss);
|
---|
215 | void NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
216 | void NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
217 | void NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
|
---|
218 | void NodalFunctionsPressure(IssmDouble* basis,Gauss* gauss);
|
---|
219 | void NodalFunctionsP1(IssmDouble* basis,Gauss* gauss);
|
---|
220 | void NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
221 | void NodalFunctionsP2(IssmDouble* basis,Gauss* gauss);
|
---|
222 | void NodalFunctionsTensor(IssmDouble* basis,Gauss* gauss);
|
---|
223 | void NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss);
|
---|
224 | void NormalBase(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
225 | void NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
226 | void NormalTop(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
227 | void SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
|
---|
228 | void InputServe(Input* input_in);
|
---|
229 | Seg* SpawnSeg(int index1,int index2);
|
---|
230 | IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
|
---|
231 | void StabilizationParameterAnisotropic(IssmDouble* tau_parameter_ansiotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
|
---|
232 | void UpdateConstraintsExtrudeFromBase(void);
|
---|
233 | void UpdateConstraintsExtrudeFromTop(void);
|
---|
234 | /*}}}*/
|
---|
235 |
|
---|
236 | };
|
---|
237 | #endif /* _TRIA_H */
|
---|