bool ConfiningStressTableModel::setData( const QModelIndex &index, const QVariant &value, int role ) { if(index.parent()!=QModelIndex()) return false; if (role==Qt::DisplayRole || role==Qt::EditRole) { switch (index.column()){ case 0: // Thickness m_layers[index.row()]->thick = value.toDouble(); computeStress(index.row()); break; case 1: // Unit Weight m_layers[index.row()]->untWt = value.toDouble(); computeStress(index.row()); break; case 2: // At Rest Coefficient m_layers[index.row()]->atRestCoeff = value.toDouble(); computeStress(index.row()); break; case 3: return false; } } dataChanged(index, index); return true; }
void LinearIsotropicMaterial::computeProperties() { for (_qp = 0; _qp < _qrule->n_points(); ++_qp) { Real alpha = computeAlpha(); _local_elasticity_tensor->calculate(_qp); _elasticity_tensor[_qp] = *_local_elasticity_tensor; SymmTensor strn(_grad_disp_x[_qp](0), _grad_disp_y[_qp](1), _grad_disp_z[_qp](2), 0.5 * (_grad_disp_x[_qp](1) + _grad_disp_y[_qp](0)), 0.5 * (_grad_disp_y[_qp](2) + _grad_disp_z[_qp](1)), 0.5 * (_grad_disp_z[_qp](0) + _grad_disp_x[_qp](2))); // Add in Isotropic Thermal Strain if (_has_temp) { Real isotropic_strain = alpha * (_temp[_qp] - _t_ref); strn.addDiag(-isotropic_strain); _d_strain_dT.zero(); _d_strain_dT.addDiag(-alpha); } SymmTensor strain(strn); computeStress(strain, _stress[_qp]); } }
void ReturnMappingModel::computeStress(const Elem & current_elem, const SymmElasticityTensor & elasticityTensor, const SymmTensor & stress_old, SymmTensor & strain_increment, SymmTensor & stress_new) { // Given the stretching, compute the stress increment and add it to the old stress. Also update // the creep strain // stress = stressOld + stressIncrement if (_t_step == 0 && !_app.isRestarting()) { if (_compute_matl_timestep_limit) (*_matl_timestep_limit)[_qp] = std::numeric_limits<Real>::max(); return; } stress_new = elasticityTensor * strain_increment; stress_new += stress_old; SymmTensor inelastic_strain_increment; computeStress(current_elem, elasticityTensor, stress_old, strain_increment, stress_new, inelastic_strain_increment); }
void LinearIsotropicMaterial::computeProperties() { for (_qp=0; _qp < _qrule->n_points(); ++_qp) { Real alpha = computeAlpha(); _local_elasticity_tensor->calculate(_qp); _elasticity_tensor[_qp] = *_local_elasticity_tensor; SymmTensor strn( _grad_disp_x[_qp](0), _grad_disp_y[_qp](1), _grad_disp_z[_qp](2), 0.5*(_grad_disp_x[_qp](1)+_grad_disp_y[_qp](0)), 0.5*(_grad_disp_y[_qp](2)+_grad_disp_z[_qp](1)), 0.5*(_grad_disp_z[_qp](0)+_grad_disp_x[_qp](2)) ); // Add in Isotropic Thermal Strain if (_has_temp) { Real isotropic_strain = alpha * (_temp[_qp] - _t_ref); strn.addDiag( -isotropic_strain ); _d_strain_dT.zero(); _d_strain_dT.addDiag( -alpha ); } SymmTensor v_strain(0); SymmTensor dv_strain_dT(0); for (unsigned int i(0); i < _volumetric_models.size(); ++i) { _volumetric_models[i]->modifyStrain(_qp, 1, v_strain, dv_strain_dT); } SymmTensor strain( v_strain ); strain *= _dt; strain += strn; dv_strain_dT *= _dt; _d_strain_dT += dv_strain_dT; computeStress(strain, _stress[_qp]); } }
void ReturnMappingModel::computeStress(const Elem & current_elem, unsigned qp, const SymmElasticityTensor & elasticityTensor, const SymmTensor & stress_old, SymmTensor & strain_increment, SymmTensor & stress_new) { // Given the stretching, compute the stress increment and add it to the old stress. Also update the creep strain // stress = stressOld + stressIncrement if (_t_step == 0 && !_app.isRestarting()) return; stress_new = elasticityTensor * strain_increment; stress_new += stress_old; SymmTensor inelastic_strain_increment; computeStress(current_elem, qp, elasticityTensor, stress_old, strain_increment, stress_new, inelastic_strain_increment); }
//------------------------------------------------------------------------------ void PD_LPS_porosity_adrmc::calculateForces(const int id, const int i) { const double theta_i = m_data(i, m_iTheta); const double m_i = m_data(i, m_iMass); const double a_i = m_data(i, m_iA); const double b_i = m_data(i, m_iA); vector<pair<int, vector<double>>> &PDconnections = m_particles.pdConnections(id); const int nConnections = PDconnections.size(); double dr0_ij[m_dim]; double dr_ij[m_dim]; _F.zeros(); double thetaNew = 0; int nConnected = 0; //---------------------------------- // TMP - standard stress calc from // m_data(i, m_indexStress[0]) = 0; // m_data(i, m_indexStress[1]) = 0; // m_data(i, m_indexStress[2]) = 0; //---------------------------------- for (int l_j = 0; l_j < nConnections; l_j++) { auto &con = PDconnections[l_j]; if (con.second[m_iConnected] <= 0.5) continue; const int id_j = con.first; const int j = m_idToCol_v[id_j]; const double m_j = m_data(j, m_iMass); const double theta_j = m_data(j, m_iTheta); const double vol_j = m_data(j, m_iVolume); const double dr0 = con.second[m_iDr0]; const double volumeScaling = con.second[m_iVolumeScaling]; const double vol = vol_j * volumeScaling; const double w = weightFunction(dr0); const double a_j = m_data(j, m_iA); const double b_j = m_data(j, m_iB); double dr2 = 0; for (int d = 0; d < m_dim; d++) { dr0_ij[d] = m_r0(j, d) - m_r0(i, d); dr_ij[d] = m_r(j, d) - m_r(i, d); dr2 += dr_ij[d] * dr_ij[d]; } const double dr = sqrt(dr2); const double ds = dr - dr0; double bond = (b_i * theta_i / m_i + b_j * theta_j / m_j) * dr0; bond += (a_i / m_i + a_j / m_j) * ds; bond *= w * vol / dr; thetaNew += w * dr0 * ds * vol; for (int d = 0; d < m_dim; d++) { m_F(i, d) += dr_ij[d] * bond; for (int d2 = 0; d2 < m_dim; d2++) { _F(d, d2) += w * dr_ij[d] * dr0_ij[d2] * vol; } } con.second[m_iStretch] = ds / dr0; //---------------------------------- // TMP - standard stres calc from // m_data(i, m_indexStress[0]) += 0.5*dr_ij[0]*dr_ij[0]*bond; // m_data(i, m_indexStress[1]) += 0.5*dr_ij[1]*dr_ij[1]*bond; // m_data(i, m_indexStress[2]) += 0.5*dr_ij[0]*dr_ij[1]*bond; //---------------------------------- nConnected++; } if (nConnections <= 3) { m_data(i, m_iThetaNew) = 0; } else { m_data(i, m_iThetaNew) = m_dim / m_i * thetaNew; } //---------------------------------- // TMP - standard stres calc from //---------------------------------- // if(nConnected > 5) { // computeStress(id, i, nConnected); // } computeStress(id, i, nConnected); //-------------------- m_continueState = false; }
glm::mat2 Stress::computeStress(Node*n){ glm::mat2 mat = computeStress(n); // mat = lambda*glm::trace(mat)*glm::mat2(1.0f) + 2*mu*mat; return mat; }
void ConfiningStressTableModel::setWaterTableDepth(double depth) { m_waterTableDepth = depth; computeStress(); }