Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79698836
patch_test_linear_elastic_implicit.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 27, 19:38
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Aug 29, 19:38 (2 d)
Engine
blob
Format
Raw Data
Handle
20187314
Attached To
rAKA akantu
patch_test_linear_elastic_implicit.cc
View Options
/* -------------------------------------------------------------------------- */
#include "patch_test_linear_fixture.hh"
/* -------------------------------------------------------------------------- */
TYPED_TEST(TestPatchTestLinear, Implicit) {
std::string filename = "material_check_stress_plane_stress.dat";
if (this->plane_strain)
filename = "material_check_stress_plane_strain.dat";
this->initModel(_static, filename);
auto & solver = this->model->getNonLinearSolver();
solver.set("max_iterations", 2);
solver.set("threshold", 2e-4);
solver.set("convergence_type", _scc_residual);
this->model->solveStep();
this->checkDisplacements();
this->checkStrains();
this->checkStresses([&](const Matrix<Real> & pstrain) {
Real nu = this->model->getMaterial(0).get("nu");
Real E = this->model->getMaterial(0).get("E");
auto strain = (pstrain + pstrain.transpose()) / 2.;
auto trace = strain.trace();
auto lambda = nu * E / ((1 + nu) * (1 - 2 * nu));
auto mu = E / (2 * (1 + nu));
if (not this->plane_strain) {
lambda = nu * E / (1 - nu * nu);
}
decltype(strain) stress(this->dim, this->dim);
if (this->dim == 1) {
stress(0, 0) = E * strain(0, 0);
} else {
for (UInt i = 0; i < this->dim; ++i)
for (UInt j = 0; j < this->dim; ++j)
stress(i, j) = (i == j) * lambda * trace + 2 * mu * strain(i, j);
}
return stress;
});
}
Event Timeline
Log In to Comment