void Foam::tetrahedron<Point, PointRef>::gradNiDotGradNj ( scalarField& buffer ) const { // Warning. Ordering of edges needs to be the same for a tetrahedron // class, a tetrahedron cell shape model and a tetCell // Warning: Added a mag to produce positive coefficients even if // the tetrahedron is twisted inside out. This is pretty // dangerous, but essential for mesh motion. // Double change of sign between face area vector and gradient scalar magVol = Foam::mag(mag()); vector sa = Sa(); vector sb = Sb(); vector sc = Sc(); vector sd = Sd(); buffer[0] = (1.0/9.0)*(sa & sb)/magVol; buffer[1] = (1.0/9.0)*(sa & sc)/magVol; buffer[2] = (1.0/9.0)*(sa & sd)/magVol; buffer[3] = (1.0/9.0)*(sd & sb)/magVol; buffer[4] = (1.0/9.0)*(sb & sc)/magVol; buffer[5] = (1.0/9.0)*(sd & sc)/magVol; }
void CEmpEdit::OnBnClickedButton6() { // TODO: Update CString SqlString,s1; CString var_name,var_id,var_sh,var_sa,var_dep,var_Eid; int flg=0,col_index=1; CEmpTable recset(&database); EID->GetWindowText(var_id); ENA->GetWindowText(var_name); EWO->GetWindowText(var_sh); ESA->GetWindowText(var_sa); EDE->GetWindowText(var_dep); CString coma(", "); //CString CB(");"); CString sc(" ;"); CString Quo("'"); CString Ei(" [Employee ID] = "); CString De(" , [Deprtment] = "); CString Sh(" , [Shift] = "); CString Sa(" , [Salary] = "); CString Id(" [ID] = "); CString sp(" AND "); CString wh(" WHERE "); CString Bo(" ( "); CString Bc(" ) "); recset.Open(CRecordset::dynaset,_T("SELECT * FROM EmpTable"),CRecordset::readOnly); recset.SetAbsolutePosition(rec_index); //recset.GetFieldValue(col_index,var_id); recset.GetFieldValue(col_index-1,var_Eid); s1.Format("UPDATE EmpTable SET [Employee Name] = "); SqlString=s1+Quo+var_name+Quo+De+Quo+var_dep+Quo+Sh+Quo+var_sh+Quo+Sa+var_sa+wh+Id+var_Eid+sc; AfxMessageBox(SqlString); try { database.ExecuteSQL(SqlString); } catch(CDBException* pe) { flg=1; // The error code is in pe->m_nRetCode pe->ReportError(); pe->Delete(); } if (flg == 0) { MessageBox(_T("Record Successfully Updated To The Database"),_T("Successfull")); } }
void Foam::tetrahedron<Point, PointRef>::gradNiGradNi ( tensorField& buffer ) const { // Change of sign between face area vector and gradient // does not matter because of square scalar magVol = Foam::mag(mag()); buffer[0] = (1.0/9.0)*sqr(Sa())/magVol; buffer[1] = (1.0/9.0)*sqr(Sb())/magVol; buffer[2] = (1.0/9.0)*sqr(Sc())/magVol; buffer[3] = (1.0/9.0)*sqr(Sd())/magVol; }
void Foam::tetrahedron<Point, PointRef>::gradNiSquared ( scalarField& buffer ) const { // Change of sign between face area vector and gradient // does not matter because of square // Warning: Added a mag to produce positive coefficients even if // the tetrahedron is twisted inside out. This is pretty // dangerous, but essential for mesh motion. scalar magVol = Foam::mag(mag()); buffer[0] = (1.0/9.0)*magSqr(Sa())/magVol; buffer[1] = (1.0/9.0)*magSqr(Sb())/magVol; buffer[2] = (1.0/9.0)*magSqr(Sc())/magVol; buffer[3] = (1.0/9.0)*magSqr(Sd())/magVol; }
//---------------------------------------------------------------------------// bool OBBClosestPoints ( LTVector3f& a, LTVector3f& b, const LTCoordinateFrameQ& A, const LTVector3f& da, const LTCoordinateFrameQ& B, const LTVector3f& db ) { //if A and B intersect, then a and b cannot be found if( OBBIntersect(A,da,B,db) ) return false; //compute the closest points a and b LTBoxSupportMap Sa( A.m_O, A, da ); LTBoxSupportMap Sb( B.m_O, B, db ); GJK_ClosestPoints( a, b, Sa, Sb ); return true; }
void Foam::tetrahedron<Point, PointRef>::gradNiGradNj ( tensorField& buffer ) const { // Warning. Ordering of edges needs to be the same for a tetrahedron // class, a tetrahedron cell shape model and a tetCell // Double change of sign between face area vector and gradient scalar magVol = Foam::mag(mag()); vector sa = Sa(); vector sb = Sb(); vector sc = Sc(); vector sd = Sd(); buffer[0] = (1.0/9.0)*(sa * sb)/magVol; buffer[1] = (1.0/9.0)*(sa * sc)/magVol; buffer[2] = (1.0/9.0)*(sa * sd)/magVol; buffer[3] = (1.0/9.0)*(sd * sb)/magVol; buffer[4] = (1.0/9.0)*(sb * sc)/magVol; buffer[5] = (1.0/9.0)*(sd * sc)/magVol; }