1 | /*!\file: Element.h
|
---|
2 | * \brief abstract class for Element object
|
---|
3 | * This class is a place holder for the Tria and the Penta elements.
|
---|
4 | * It is derived from Element, so DataSets can contain them.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #ifndef _ELEMENT_H_
|
---|
8 | #define _ELEMENT_H_
|
---|
9 |
|
---|
10 | /*Headers:*/
|
---|
11 | /*{{{*/
|
---|
12 | #include "../../datastructures/datastructures.h"
|
---|
13 | #include "../../toolkits/toolkits.h"
|
---|
14 | #include "../Update.h"
|
---|
15 | class DataSet;
|
---|
16 | class Parameters;
|
---|
17 | class Elements;
|
---|
18 | class Loads;
|
---|
19 | class Node;
|
---|
20 | class Nodes;
|
---|
21 | class Vertices;
|
---|
22 | class Materials;
|
---|
23 | class Matpar;
|
---|
24 | class Input;
|
---|
25 | class Inputs;
|
---|
26 | class Gauss;
|
---|
27 | class ElementVector;
|
---|
28 | template <class doublematrix> class Matrix;
|
---|
29 | template <class doubletype> class Vector;
|
---|
30 | class ElementMatrix;
|
---|
31 | class ElementVector;
|
---|
32 | /*}}}*/
|
---|
33 |
|
---|
34 | class Element: public Object,public Update{
|
---|
35 |
|
---|
36 | public:
|
---|
37 | Inputs *inputs;
|
---|
38 | Node **nodes;
|
---|
39 |
|
---|
40 | public:
|
---|
41 | /*Constructors/Destructores*/
|
---|
42 | Element();
|
---|
43 | ~Element();
|
---|
44 |
|
---|
45 | /*Functions*/
|
---|
46 | void AddInput(Input* input_in);
|
---|
47 | bool AllActive(void);
|
---|
48 | bool AnyActive(void);
|
---|
49 | Input* GetInput(int inputenum);
|
---|
50 |
|
---|
51 | /*Virtual functions*/
|
---|
52 | virtual void AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
|
---|
53 | virtual void AddInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
|
---|
54 | virtual void AddMaterialInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
|
---|
55 | virtual IssmDouble CharacteristicLength(void)=0;
|
---|
56 | virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
|
---|
57 | virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters)=0;
|
---|
58 | virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum)=0;
|
---|
59 | virtual ElementMatrix* CreateKMatrix(void)=0;
|
---|
60 | virtual void CreateDVector(Vector<IssmDouble>* df)=0;
|
---|
61 | virtual ElementVector* CreatePVector(void)=0;
|
---|
62 | virtual void CreateJacobianMatrix(Matrix<IssmDouble>* Jff)=0;
|
---|
63 | virtual void DeleteMaterials(void)=0;
|
---|
64 | virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
|
---|
65 | virtual void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure)=0;
|
---|
66 | virtual IssmDouble EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure)=0;
|
---|
67 | virtual IssmDouble EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure)=0;
|
---|
68 | virtual void FindParam(bool* pvalue,int paramenum)=0;
|
---|
69 | virtual void FindParam(int* pvalue,int paramenum)=0;
|
---|
70 | virtual void FindParam(IssmDouble* pvalue,int paramenum)=0;
|
---|
71 | virtual void FindParam(int** pvalues,int* psize,int paramenum)=0;
|
---|
72 | virtual int FiniteElement(void)=0;
|
---|
73 | virtual IssmDouble GetMaterialParameter(int enum_in)=0;
|
---|
74 | virtual IssmDouble MinEdgeLength(IssmDouble* xyz_list)=0;
|
---|
75 | virtual void NodalFunctions(IssmDouble* basis,Gauss* gauss)=0;
|
---|
76 | virtual void NodalFunctionsVelocity(IssmDouble* basis, Gauss* gauss)=0;
|
---|
77 | virtual void NodalFunctionsPressure(IssmDouble* basis, Gauss* gauss)=0;
|
---|
78 | virtual void NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss)=0;
|
---|
79 | virtual void NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss)=0;
|
---|
80 | virtual void NormalSection(IssmDouble* normal,IssmDouble* xyz_list)=0;
|
---|
81 | virtual void NormalTop(IssmDouble* normal,IssmDouble* xyz_list)=0;
|
---|
82 | virtual void NormalBase(IssmDouble* normal,IssmDouble* xyz_list)=0;
|
---|
83 | virtual IssmDouble PureIceEnthalpy(IssmDouble pressure)=0;
|
---|
84 | virtual void TransformLoadVectorCoord(ElementVector* pe,int transformenum)=0;
|
---|
85 | virtual void TransformLoadVectorCoord(ElementVector* pe,int* transformenum_list)=0;
|
---|
86 | virtual void TransformLoadVectorCoord(ElementVector* pe,int numnodes,int transformenum)=0;
|
---|
87 | virtual void TransformLoadVectorCoord(ElementVector* pe,int numnodes,int* transformenum_list)=0;
|
---|
88 | virtual void TransformSolutionCoord(IssmDouble* values,int transformenum)=0;
|
---|
89 | virtual void TransformSolutionCoord(IssmDouble* values,int* transformenum_list)=0;
|
---|
90 | virtual void TransformSolutionCoord(IssmDouble* values,int numnodes,int transformenum)=0;
|
---|
91 | virtual void TransformSolutionCoord(IssmDouble* values,int numnodes,int* transformenum_list)=0;
|
---|
92 | virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int transformenum)=0;
|
---|
93 | virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int* transformenum_list)=0;
|
---|
94 | virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int numnodes,int transformenum)=0;
|
---|
95 | virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int numnodes,int* transformenum_list)=0;
|
---|
96 | virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes_list,int numnodes,int* transformenum_list)=0;
|
---|
97 | virtual Element* GetBasalElement(void)=0;
|
---|
98 | virtual void GetDofList(int** pdoflist,int approximation_enum,int setenum)=0;
|
---|
99 | virtual void GetDofListVelocity(int** pdoflist,int setenum)=0;
|
---|
100 | virtual void GetDofListPressure(int** pdoflist,int setenum)=0;
|
---|
101 | virtual void JacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
|
---|
102 | virtual void JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
|
---|
103 | virtual void JacobianDeterminantSurface(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
|
---|
104 | virtual void JacobianDeterminantBase(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0;
|
---|
105 | virtual void JacobianDeterminantTop(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0;
|
---|
106 | virtual void GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int solutionenum)=0;
|
---|
107 | virtual int GetNodeIndex(Node* node)=0;
|
---|
108 | virtual int GetNumberOfNodes(void)=0;
|
---|
109 | virtual int GetNumberOfNodesVelocity(void)=0;
|
---|
110 | virtual int GetNumberOfNodesPressure(void)=0;
|
---|
111 | virtual int GetNumberOfVertices(void)=0;
|
---|
112 | virtual void GetNodesSidList(int* sidlist)=0;
|
---|
113 | virtual void GetNodesLidList(int* sidlist)=0;
|
---|
114 |
|
---|
115 | virtual int Sid()=0;
|
---|
116 | virtual bool IsFloating()=0;
|
---|
117 | virtual bool IsNodeOnShelfFromFlags(IssmDouble* flags)=0;
|
---|
118 | virtual bool IsOnBed()=0;
|
---|
119 | virtual bool IsOnSurface()=0;
|
---|
120 | virtual void GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0;
|
---|
121 | virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0;
|
---|
122 | virtual void GetInputListOnNodes(IssmDouble* pvalue,int enumtype)=0;
|
---|
123 | virtual void GetInputListOnNodes(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue)=0;
|
---|
124 | virtual void GetInputListOnVertices(IssmDouble* pvalue,int enumtype)=0;
|
---|
125 | virtual void GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue)=0;
|
---|
126 | virtual Input* GetMaterialInput(int inputenum)=0;
|
---|
127 | virtual void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0;
|
---|
128 | virtual void GetInputValue(bool* pvalue,int enum_type)=0;
|
---|
129 | virtual void GetInputValue(int* pvalue,int enum_type)=0;
|
---|
130 | virtual void GetInputValue(IssmDouble* pvalue,int enum_type)=0;
|
---|
131 | virtual void GetInputValue(IssmDouble* pvalue,Gauss* gauss,int enum_type)=0;
|
---|
132 | virtual Node* GetNode(int node_number)=0;
|
---|
133 | virtual void GetVerticesCoordinates(IssmDouble** xyz_list)=0;
|
---|
134 | virtual void GetVerticesCoordinatesBase(IssmDouble** xyz_list)=0;
|
---|
135 | virtual void GetVerticesCoordinatesTop(IssmDouble** xyz_list)=0;
|
---|
136 | virtual IssmDouble GetZcoord(Gauss* gauss)=0;
|
---|
137 | virtual IssmDouble GetYcoord(Gauss* gauss)=0;
|
---|
138 | virtual void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0;
|
---|
139 |
|
---|
140 | virtual IssmDouble SurfaceArea(void)=0;
|
---|
141 | virtual void InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
|
---|
142 | virtual void InputChangeName(int enum_type,int enum_type_old)=0;
|
---|
143 | virtual void ComputeBasalStress(Vector<IssmDouble>* sigma_b)=0;
|
---|
144 | virtual void ComputeStrainRate(Vector<IssmDouble>* eps)=0;
|
---|
145 | virtual void ComputeStressTensor(void)=0;
|
---|
146 | virtual void ResultInterpolation(int* pinterpolation,int output_enum)=0;
|
---|
147 | virtual void ResultToVector(Vector<IssmDouble>* vector,int output_enum)=0;
|
---|
148 | virtual void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finite_element)=0;
|
---|
149 | virtual void InputDuplicate(int original_enum,int new_enum)=0;
|
---|
150 | virtual void InputCreate(IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code)=0;
|
---|
151 | virtual void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int inputenum)=0;
|
---|
152 | virtual void InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum)=0;
|
---|
153 |
|
---|
154 | virtual int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum)=0;
|
---|
155 | virtual int NumberofNodesVelocity(void)=0;
|
---|
156 | virtual int NumberofNodesPressure(void)=0;
|
---|
157 | virtual Gauss* NewGauss(void)=0;
|
---|
158 | virtual Gauss* NewGauss(int order)=0;
|
---|
159 | virtual Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order)=0;
|
---|
160 | virtual Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert)=0;
|
---|
161 | virtual Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order)=0;
|
---|
162 | virtual Gauss* NewGaussBase(int order)=0;
|
---|
163 | virtual Gauss* NewGaussLine(int vertex1,int vertex2,int order)=0;
|
---|
164 | virtual Gauss* NewGaussTop(int order)=0;
|
---|
165 | virtual ElementVector* NewElementVector(int approximation_enum=NoneApproximationEnum)=0;
|
---|
166 | virtual ElementMatrix* NewElementMatrix(int approximation_enum=NoneApproximationEnum)=0;
|
---|
167 | virtual void InputScale(int enum_type,IssmDouble scale_factor)=0;
|
---|
168 | virtual void GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum)=0;
|
---|
169 | virtual IssmDouble TimeAdapt()=0;
|
---|
170 | virtual void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
|
---|
171 | virtual void Delta18oParameterization(void)=0;
|
---|
172 | virtual void SmbGradients(void)=0;
|
---|
173 | virtual Element* SpawnBasalElement(void)=0;
|
---|
174 | virtual IssmDouble TMeltingPoint(IssmDouble pressure)=0;
|
---|
175 | virtual void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe)=0;
|
---|
176 | virtual void ResetCoordinateSystem()=0;
|
---|
177 | virtual IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa)=0;
|
---|
178 | virtual void ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss)=0;
|
---|
179 | virtual void ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss)=0;
|
---|
180 | virtual void ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
|
---|
181 | virtual void ViscosityFS(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
|
---|
182 | virtual void ViscosityHO(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
|
---|
183 | virtual void ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf)=0;
|
---|
184 | virtual void ViscositySSA(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
|
---|
185 | virtual void ViscositySSADerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon)=0;
|
---|
186 | virtual void ViscosityHODerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon)=0;
|
---|
187 | virtual void ViscosityFSDerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon)=0;
|
---|
188 | virtual void StrainRateSSA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
|
---|
189 | virtual void StrainRateHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
|
---|
190 | virtual void StrainRateFS(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
|
---|
191 | virtual int VelocityInterpolation()=0;
|
---|
192 | virtual int PressureInterpolation()=0;
|
---|
193 | virtual bool IsZeroLevelset(int levelset_enum)=0;
|
---|
194 | virtual void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum)=0;
|
---|
195 |
|
---|
196 | #ifdef _HAVE_RESPONSES_
|
---|
197 | virtual void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
|
---|
198 | virtual void MinVel(IssmDouble* pminvel)=0;
|
---|
199 | virtual void MaxVel(IssmDouble* pmaxvel)=0;
|
---|
200 | virtual void MinVx(IssmDouble* pminvx)=0;
|
---|
201 | virtual void MaxVx(IssmDouble* pmaxvx)=0;
|
---|
202 | virtual void MaxAbsVx(IssmDouble* pmaxabsvx)=0;
|
---|
203 | virtual void MinVy(IssmDouble* pminvy)=0;
|
---|
204 | virtual void MaxVy(IssmDouble* pmaxvy)=0;
|
---|
205 | virtual void MaxAbsVy(IssmDouble* pmaxabsvy)=0;
|
---|
206 | virtual void MinVz(IssmDouble* pminvz)=0;
|
---|
207 | virtual void MaxVz(IssmDouble* pmaxvz)=0;
|
---|
208 | virtual void MaxAbsVz(IssmDouble* pmaxabsvz)=0;
|
---|
209 | virtual IssmDouble MassFlux(IssmDouble* segment)=0;
|
---|
210 | virtual IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id)=0;
|
---|
211 | virtual void ElementResponse(IssmDouble* presponse,int response_enum)=0;
|
---|
212 | virtual IssmDouble IceVolume(void)=0;
|
---|
213 | virtual IssmDouble IceVolumeAboveFloatation(void)=0;
|
---|
214 | virtual IssmDouble TotalSmb(void)=0;
|
---|
215 | virtual IssmDouble Misfit(int modelenum,int observationenum,int weightsenum)=0;
|
---|
216 | virtual int VertexConnectivity(int vertexindex)=0;
|
---|
217 | virtual void VerticalSegmentIndices(int** pindices,int* pnumseg)=0;
|
---|
218 | #endif
|
---|
219 |
|
---|
220 | #ifdef _HAVE_GIA_
|
---|
221 | virtual void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y)=0;
|
---|
222 | #endif
|
---|
223 |
|
---|
224 | #ifdef _HAVE_CONTROL_
|
---|
225 | virtual void Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index)=0;
|
---|
226 | virtual IssmDouble ThicknessAbsMisfit(void)=0;
|
---|
227 | virtual IssmDouble SurfaceAbsVelMisfit(void)=0;
|
---|
228 | virtual IssmDouble SurfaceRelVelMisfit(void)=0;
|
---|
229 | virtual IssmDouble SurfaceLogVelMisfit(void)=0;
|
---|
230 | virtual IssmDouble SurfaceLogVxVyMisfit(void)=0;
|
---|
231 | virtual IssmDouble SurfaceAverageVelMisfit(void)=0;
|
---|
232 | virtual IssmDouble ThicknessAbsGradient(void)=0;
|
---|
233 | virtual IssmDouble ThicknessAlongGradient(void)=0;
|
---|
234 | virtual IssmDouble ThicknessAcrossGradient(void)=0;
|
---|
235 | virtual IssmDouble BalancethicknessMisfit(void)=0;
|
---|
236 | virtual IssmDouble RheologyBbarAbsGradient(void)=0;
|
---|
237 | virtual IssmDouble DragCoefficientAbsGradient(void)=0;
|
---|
238 | virtual void ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index)=0;
|
---|
239 | virtual void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index)=0;
|
---|
240 | virtual void ControlInputScaleGradient(int enum_type, IssmDouble scale)=0;
|
---|
241 | virtual void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum)=0;
|
---|
242 | virtual void GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data)=0;
|
---|
243 | virtual void SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
|
---|
244 | virtual void InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;
|
---|
245 | #endif
|
---|
246 |
|
---|
247 | virtual void UpdateConstraintsExtrudeFromBase(void)=0;
|
---|
248 | virtual void UpdateConstraintsExtrudeFromTop(void)=0;
|
---|
249 |
|
---|
250 | #ifdef _HAVE_THERMAL_
|
---|
251 | virtual void UpdateBasalConstraintsEnthalpy(void)=0;
|
---|
252 | virtual void ComputeBasalMeltingrate(void)=0;
|
---|
253 | virtual void DrainWaterfraction(IssmDouble* drainrate_element)=0;
|
---|
254 | #endif
|
---|
255 |
|
---|
256 | #ifdef _HAVE_HYDROLOGY_
|
---|
257 | virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode)=0;
|
---|
258 | virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, int index)=0;
|
---|
259 | virtual void GetHydrologyTransfer(Vector<IssmDouble>* transfer)=0;
|
---|
260 | virtual void HydrologyEPLGetMask(Vector<IssmDouble>* mask)=0;
|
---|
261 | virtual void HydrologyEPLGetActive(Vector<IssmDouble>* active)=0;
|
---|
262 | virtual void ComputeEPLThickness(void)=0;
|
---|
263 | #endif
|
---|
264 |
|
---|
265 | #ifdef _HAVE_GROUNDINGLINE_
|
---|
266 | virtual void MigrateGroundingLine(IssmDouble* sheet_ungrounding)=0;
|
---|
267 | virtual void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
|
---|
268 | virtual int UpdatePotentialUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
|
---|
269 | #endif
|
---|
270 |
|
---|
271 | };
|
---|
272 | #endif
|
---|