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 Matlitho;
|
---|
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 | int iscollapsed;
|
---|
34 |
|
---|
35 | /*Tria constructors, destructors {{{*/
|
---|
36 | Tria(){};
|
---|
37 | Tria(int tria_id,int tria_sid,int tria_lid,IoModel* iomodel,int nummodels);
|
---|
38 | ~Tria();
|
---|
39 | /*}}}*/
|
---|
40 | /*Object virtual functions definitions:{{{ */
|
---|
41 | Object *copy();
|
---|
42 | void Marshall(MarshallHandle* marshallhandle);
|
---|
43 | int ObjectEnum();
|
---|
44 | /*}}}*/
|
---|
45 | /*Update virtual functions resolution: {{{*/
|
---|
46 | #ifdef _HAVE_DAKOTA_
|
---|
47 | void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nows, int ncols, int name, int type);
|
---|
48 | void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
|
---|
49 | void InputScaleFromDakota(IssmDouble* distributed_values, IssmDouble* partition, int npart, int nt, int name);
|
---|
50 | #endif
|
---|
51 | void InputUpdateFromIoModel(int index, IoModel* iomodel);
|
---|
52 | void InputUpdateFromVector(IssmDouble* vector, int name, int type);
|
---|
53 | /*}}}*/
|
---|
54 | /*Element virtual functions definitions: {{{*/
|
---|
55 | void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
|
---|
56 | void CalvingRateVonmises();
|
---|
57 | void CalvingRateVonmisesAD();
|
---|
58 | void CalvingRateTest();
|
---|
59 | void CalvingCrevasseDepth();
|
---|
60 | void CalvingRateLevermann();
|
---|
61 | void CalvingPollard();
|
---|
62 | void CalvingFluxLevelset();
|
---|
63 | void CalvingMeltingFluxLevelset();
|
---|
64 | void CalvingRateParameterization();
|
---|
65 | void CalvingRateCalvingMIP();
|
---|
66 | IssmDouble CharacteristicLength(void);
|
---|
67 | void ComputeBasalStress(void);
|
---|
68 | void ComputeDeviatoricStressTensor();
|
---|
69 | void ComputeEsaStrainAndVorticity();
|
---|
70 | void ComputeSigmaNN();
|
---|
71 | void ComputeSigmaVM();
|
---|
72 | void ComputeStressTensor();
|
---|
73 | void ComputeSurfaceNormalVelocity();
|
---|
74 | void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters,Inputs* inputsin);
|
---|
75 | void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int M,int N,int interp);
|
---|
76 | void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp);
|
---|
77 | void CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
|
---|
78 | void ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical=false);
|
---|
79 | void ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae);
|
---|
80 | int EdgeOnBaseIndex();
|
---|
81 | void EdgeOnBaseIndices(int* pindex1,int* pindex);
|
---|
82 | int EdgeOnSurfaceIndex();
|
---|
83 | void EdgeOnSurfaceIndices(int* pindex1,int* pindex);
|
---|
84 | void ElementResponse(IssmDouble* presponse,int response_enum);
|
---|
85 | void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
|
---|
86 | int FiniteElement(void);
|
---|
87 | IssmDouble FloatingArea(bool scaled);
|
---|
88 | void FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure);
|
---|
89 | Element* GetBasalElement(void){_error_("not implemented yet");};
|
---|
90 | void GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues);
|
---|
91 | void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
|
---|
92 | IssmDouble GetGroundedPortion(IssmDouble* xyz_list);
|
---|
93 | void GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl);
|
---|
94 | void GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelsetenum);
|
---|
95 | void GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum);
|
---|
96 | void GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius);
|
---|
97 | IssmDouble GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]);
|
---|
98 | IssmDouble GetIcefrontArea();
|
---|
99 | void GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
|
---|
100 | void GetInputListOnVertices(IssmDouble* pvalue,Input* input,IssmDouble default_value);
|
---|
101 | void GetInputListOnNodes(IssmDouble* pvalue,Input* input,IssmDouble default_value);
|
---|
102 | void GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level);
|
---|
103 | int GetVertexIndex(Vertex* vertex);
|
---|
104 | int GetNumberOfNodes(void);
|
---|
105 | int GetNumberOfNodes(int enum_type);
|
---|
106 | int GetNumberOfVertices(void);
|
---|
107 | void GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,int N,const char* data,int offset);
|
---|
108 | void GetVerticesCoordinatesBase(IssmDouble** pxyz_list);
|
---|
109 | void GetVerticesCoordinatesTop(IssmDouble** pxyz_list);
|
---|
110 | IssmDouble GroundedArea(bool scaled);
|
---|
111 | bool HasEdgeOnBase();
|
---|
112 | bool HasEdgeOnSurface();
|
---|
113 | IssmDouble IceVolume(bool scaled);
|
---|
114 | IssmDouble IceVolumeAboveFloatation(bool scaled);
|
---|
115 | IssmDouble IcefrontMassFlux(bool scaled);
|
---|
116 | IssmDouble IcefrontMassFluxLevelset(bool scaled);
|
---|
117 | IssmDouble GroundinglineMassFlux(bool scaled);
|
---|
118 | void InputDepthAverageAtBase(int enum_type,int average_enum_type);
|
---|
119 | void InputExtrude(int enum_type,int start){_error_("not implemented"); /*For penta only*/};
|
---|
120 | void ControlInputExtrude(int enum_type,int start){/*For penta only*/};
|
---|
121 | bool IsFaceOnBoundary(void);
|
---|
122 | bool IsIcefront(void);
|
---|
123 | bool IsNodeOnShelfFromFlags(IssmDouble* flags);
|
---|
124 | bool IsZeroLevelset(int levelset_enum);
|
---|
125 | IssmDouble Masscon(IssmDouble* levelset);
|
---|
126 | IssmDouble MassFlux(IssmDouble* segment);
|
---|
127 | IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
|
---|
128 | void MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
|
---|
129 | IssmDouble Misfit(int modelenum,int observationenum,int weightsenum);
|
---|
130 | IssmDouble MisfitArea(int weightsenum);
|
---|
131 | int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum);
|
---|
132 | int NumberofNodesPressure(void);
|
---|
133 | int NumberofNodesVelocity(void);
|
---|
134 | void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
|
---|
135 | int PressureInterpolation();
|
---|
136 | void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
|
---|
137 | void ResetFSBasalBoundaryCondition(void);
|
---|
138 | void ResetHooks();
|
---|
139 | void ResetLevelsetFromSegmentlist(IssmDouble* segments,int numsegments);
|
---|
140 | void SetElementInput(int enum_in,IssmDouble value);
|
---|
141 | void SetElementInput(int enum_in,IssmDouble value,int type);
|
---|
142 | void SetElementInput(Inputs* inputs,int enum_in,IssmDouble value);
|
---|
143 | void SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in);
|
---|
144 | void SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M,int N);
|
---|
145 | void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
|
---|
146 | Element* SpawnBasalElement(bool depthaverage_materials);
|
---|
147 | Element* SpawnTopElement(void);
|
---|
148 | bool IsSpawnedElement(void);
|
---|
149 | void StrainRateparallel();
|
---|
150 | void StrainRateperpendicular();
|
---|
151 | void StressIntensityFactor(void){_error_("not implemented yet");};
|
---|
152 | IssmDouble SurfaceArea(void);
|
---|
153 | int TensorInterpolation();
|
---|
154 | IssmDouble TimeAdapt();
|
---|
155 | IssmDouble TotalCalvingFluxLevelset(bool scaled);
|
---|
156 | IssmDouble TotalCalvingMeltingFluxLevelset(bool scaled);
|
---|
157 | IssmDouble TotalFloatingBmb(bool scaled);
|
---|
158 | IssmDouble TotalGroundedBmb(bool scaled);
|
---|
159 | IssmDouble TotalSmb(bool scaled);
|
---|
160 | IssmDouble TotalSmbMelt(bool scaled);
|
---|
161 | IssmDouble TotalSmbRefreeze(bool scaled);
|
---|
162 | void Update(Inputs* inputs,int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement);
|
---|
163 | int UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
|
---|
164 | void ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss);
|
---|
165 | void ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss);
|
---|
166 | int VelocityInterpolation();
|
---|
167 | int VertexConnectivity(int vertexindex);
|
---|
168 | void VerticalSegmentIndices(int** pindices,int* pnumseg){_error_("not implemented yet");};
|
---|
169 | void VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");};
|
---|
170 | void WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue);
|
---|
171 |
|
---|
172 | #ifdef _HAVE_ESA_
|
---|
173 | void EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy);
|
---|
174 | void EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz);
|
---|
175 | #endif
|
---|
176 | #ifdef _HAVE_SEALEVELCHANGE_
|
---|
177 | void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
|
---|
178 | void SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae, int* lids, int* vcount);
|
---|
179 | void SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom);
|
---|
180 | void SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae);
|
---|
181 | void SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
|
---|
182 | void SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom);
|
---|
183 | void SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
|
---|
184 | void SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom);
|
---|
185 | void SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
|
---|
186 | void SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom);
|
---|
187 | void SealevelchangeUpdateViscousFields(IssmDouble lincoeff, int newindex, int offset);
|
---|
188 | #endif
|
---|
189 | /*}}}*/
|
---|
190 | /*Tria specific routines:{{{*/
|
---|
191 | void AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum);
|
---|
192 | void AddInput(int input_enum, IssmDouble* values, int interpolation_enum);
|
---|
193 | void AddControlInput(int input_enum,Inputs* inputs,IoModel* iomodel,IssmDouble* values,IssmDouble* values_min,IssmDouble* values_max, int interpolation_enum,int id);
|
---|
194 | void DatasetInputCreate(IssmDouble* array,int M,int N,int* individual_enums,int num_inputs,Inputs* inputs,IoModel* iomodel,int input_enum);
|
---|
195 | void CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble init_time,IssmDouble end_time,int averaging_method);
|
---|
196 | void GetInputAveragesUpToCurrentTime(int input_enum,IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
|
---|
197 | IssmDouble GetArea(void);
|
---|
198 | IssmDouble GetHorizontalSurfaceArea(void);
|
---|
199 | IssmDouble GetArea3D(void);
|
---|
200 | IssmDouble GetAreaIce(void);
|
---|
201 | IssmDouble GetAreaSpherical(void);
|
---|
202 | void GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints);
|
---|
203 | int GetElementType(void);
|
---|
204 | Input* GetInput(int enumtype);
|
---|
205 | Input* GetInput(int enumtype,IssmDouble time);
|
---|
206 | Input* GetInput(int inputenum,IssmDouble start_time,IssmDouble end_time,int averaging_method);
|
---|
207 | DatasetInput* GetDatasetInput(int inputenum);
|
---|
208 | void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
|
---|
209 | void GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype);
|
---|
210 | void GetLevelsetIntersection(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level);
|
---|
211 | void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype);
|
---|
212 | void InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type);
|
---|
213 | void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int enum_type){_error_("not implemented yet");};
|
---|
214 | void JacobianDeterminant(IssmDouble* pJdet, IssmDouble* xyz_list,Gauss* gauss);
|
---|
215 | void JacobianDeterminantBase(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
|
---|
216 | void JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
|
---|
217 | void JacobianDeterminantSurface(IssmDouble* pJdet, IssmDouble* xyz_list,Gauss* gauss);
|
---|
218 | void JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
|
---|
219 | IssmDouble MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
|
---|
220 | void MovingFrontalVelocity(void);
|
---|
221 | Gauss* NewGauss(void);
|
---|
222 | Gauss* NewGauss(int order);
|
---|
223 | Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
|
---|
224 | Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
|
---|
225 | Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,int order);
|
---|
226 | Gauss* NewGauss(IssmDouble fraction1,IssmDouble fraction2,int order);
|
---|
227 | Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
|
---|
228 | Gauss* NewGaussBase(int order);
|
---|
229 | Gauss* NewGaussLine(int vertex1,int vertex2,int order){_error_("not implemented yet");};
|
---|
230 | Gauss* NewGaussTop(int order);
|
---|
231 | void NodalFunctions(IssmDouble* basis,Gauss* gauss);
|
---|
232 | void NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
233 | void NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
234 | void NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
|
---|
235 | void NodalFunctionsPressure(IssmDouble* basis,Gauss* gauss);
|
---|
236 | void NodalFunctionsP1(IssmDouble* basis,Gauss* gauss);
|
---|
237 | void NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
|
---|
238 | void NodalFunctionsP2(IssmDouble* basis,Gauss* gauss);
|
---|
239 | void NodalFunctionsTensor(IssmDouble* basis,Gauss* gauss);
|
---|
240 | void NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss);
|
---|
241 | void NormalBase(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
242 | void NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
243 | void NormalTop(IssmDouble* normal,IssmDouble* xyz_list);
|
---|
244 | void SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
|
---|
245 | void InputServe(Input* input_in);
|
---|
246 | Seg* SpawnSeg(int index1,int index2);
|
---|
247 | IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
|
---|
248 | void StabilizationParameterAnisotropic(IssmDouble* tau_parameter_ansiotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
|
---|
249 | void UpdateConstraintsExtrudeFromBase(void);
|
---|
250 | void UpdateConstraintsExtrudeFromTop(void);
|
---|
251 | IssmDouble* SealevelchangeGxL(IssmDouble* G, IssmDouble* Grot, GrdLoads* loads, IssmDouble* polarmotionvector, SealevelGeometry* slgeom, int nel, bool computefuture);
|
---|
252 | IssmDouble* SealevelchangeHorizGxL(int spatial_component, IssmDouble* G, IssmDouble* Grot, GrdLoads* loads, IssmDouble* polarmotionvector, SealevelGeometry* slgeom, int nel, bool computefuture);
|
---|
253 | void SealevelchangeCollectGrdfield(IssmDouble* grdfieldout, IssmDouble* grdfield, SealevelGeometry* slgeom, int nel, bool percpu, int viscousenum, bool computefuture);
|
---|
254 | /*}}}*/
|
---|
255 |
|
---|
256 | };
|
---|
257 | #endif /* _TRIA_H */
|
---|