Changeset 16807 for issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
- Timestamp:
- 11/16/13 20:14:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16805 r16807 1162 1162 1163 1163 }/*}}}*/ 1164 /*FUNCTION Tria:: GetSegmentNormal{{{*/1165 void Tria:: GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]){1164 /*FUNCTION Tria::NormalBase {{{*/ 1165 void Tria::NormalBase(IssmDouble* normal,IssmDouble* xyz_list){ 1166 1166 1167 1167 /*Build unit outward pointing vector*/ … … 1169 1169 IssmDouble norm; 1170 1170 1171 vector[0]=xyz_list[1 ][0] - xyz_list[0][0];1172 vector[1]=xyz_list[1 ][1] - xyz_list[0][1];1171 vector[0]=xyz_list[1*3+0] - xyz_list[0*3+0]; 1172 vector[1]=xyz_list[1*3+1] - xyz_list[0*3+1]; 1173 1173 1174 1174 norm=sqrt(vector[0]*vector[0] + vector[1]*vector[1]); … … 1976 1976 1977 1977 bool onbed; 1978 inputs->GetInputValue(&onbed,MeshElementonbedEnum); 1978 int meshtype; 1979 this->parameters->FindParam(&meshtype,MeshTypeEnum); 1980 switch(meshtype){ 1981 case Mesh2DverticalEnum: 1982 return HasEdgeOnBed(); 1983 break; 1984 case Mesh2DhorizontalEnum: 1985 inputs->GetInputValue(&onbed,MeshElementonbedEnum); 1986 break; 1987 default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet"); 1988 } 1979 1989 return onbed; 1980 1990 } … … 3876 3886 GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIceLevelsetEnum); 3877 3887 GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,2); 3878 GetSegmentNormal(&normal[0],xyz_list_front);3888 NormalBase(&normal[0],&xyz_list_front[0][0]); 3879 3889 3880 3890 /*Start looping on Gaussian points*/ … … 4022 4032 GetNodalFunctionsVelocity(vbasis, gauss); 4023 4033 4024 GetSegmentNormal(&normal[0],xyz_list_seg);4034 NormalBase(&normal[0],&xyz_list_seg[0][0]); 4025 4035 _assert_(normal[1]<0.); 4026 4036 bed_input->GetInputValue(&bed, gauss); … … 4157 4167 GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIceLevelsetEnum); 4158 4168 GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,2); 4159 GetSegmentNormal(&normal[0],xyz_list_front);4169 NormalBase(&normal[0],&xyz_list_front[0][0]); 4160 4170 4161 4171 /*Start looping on Gaussian points*/ … … 7125 7135 this->EdgeOnSurfaceIndices(&indices[0],&indices[1]); 7126 7136 for(int i=0;i<NUMVERTICES1D;i++) for(int j=0;j<2;j++) xyz_list_seg[i][j]=xyz_list[indices[i]][j]; 7127 GetSegmentNormal(&normal[0],xyz_list_seg);7137 NormalBase(&normal[0],&xyz_list_seg[0][0]); 7128 7138 7129 7139 /* Start looping on the number of gaussian points: */ … … 7175 7185 this->EdgeOnBedIndices(&indices[0],&indices[1]); 7176 7186 for(int i=0;i<NUMVERTICES1D;i++) for(int j=0;j<2;j++) xyz_list_seg[i][j]=xyz_list[indices[i]][j]; 7177 GetSegmentNormal(&normal[0],xyz_list_seg);7187 NormalBase(&normal[0],&xyz_list_seg[0][0]); 7178 7188 7179 7189 /* Start looping on the number of gaussian points: */
Note:
See TracChangeset
for help on using the changeset viewer.