Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78580506
test_structural_mechanics_model_discrete_kirchhoff_triangle_18.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
Wed, Aug 21, 18:28
Size
3 KB
Mime Type
text/x-c++
Expires
Fri, Aug 23, 18:28 (2 d)
Engine
blob
Format
Raw Data
Handle
20064666
Attached To
rAKA akantu
test_structural_mechanics_model_discrete_kirchhoff_triangle_18.cc
View Options
/**
* @file test_structural_mechanics_model_bernoulli_beam_2.cc
*
* @author Fabian Barras <fabian.barras@epfl.ch>
* @author Lucas Frérot <lucas.frerot@epfl.ch>
*
* @date creation: Fri Jul 15 2011
* @date last modification: Sun Oct 19 2014
*
* @brief Computation of the analytical exemple 1.1 in the TGC vol 6
*
* @section LICENSE
*
* Copyright (©) 2010-2012, 2014, 2015 EPFL (Ecole Polytechnique Fédérale de
* Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
* Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "test_structural_mechanics_model_fixture.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
using namespace akantu;
/* -------------------------------------------------------------------------- */
class TestStructDKT18
: public TestStructuralFixture<element_type_t<_discrete_kirchhoff_triangle_18>> {
using parent = TestStructuralFixture<element_type_t<_discrete_kirchhoff_triangle_18>>;
public:
void addMaterials() override {
mat.E = 1;
mat.t = 1;
mat.nu = 0.3;
this->model->addMaterial(mat);
}
void assignMaterials() override {
auto & materials = this->model->getElementMaterial(parent::type);
std::fill(materials.begin(), materials.end(), 0);
}
void setDirichlets() override {
std::fill(this->model->getBlockedDOFs().begin(),
this->model->getBlockedDOFs().end(), true);
auto center_node = this->model->getBlockedDOFs().end(parent::ndof) - 1;
// clang-format off
*center_node = {false, false, false, false, false, true};
// clang-format on
this->model->getDisplacement().clear();
auto disp = ++this->model->getDisplacement().begin(parent::ndof);
// Displacement field from Batoz Vol. 2 p. 392
// with theta to beta correction from discrete Kirchhoff condition
//clang-format off
*disp = {40, 20, -800 , -20, 40, 0}; ++disp;
*disp = {50, 40, -1400, -40, 50, 0}; ++disp;
*disp = {10, 20, -200 , -20, 10, 0}; ++disp;
//clang-format on
}
void setNeumanns() override {}
protected:
StructuralMaterial mat;
};
/* -------------------------------------------------------------------------- */
// Batoz Vol 2. patch test, ISBN 2-86601-259-3
TEST_F(TestStructDKT18, TestDisplacements) {
model->solveStep();
Vector<Real> solution = {22.5, 22.5, -337.5, -22.5, 22.5, 0};
Vector<Real> center_node_disp =
model->getDisplacement().end(model->getSpatialDimension())[-1];
auto error = solution - center_node_disp;
Real tol = Math::getTolerance();
EXPECT_NEAR(error.norm<L_2>(), 0., tol);
}
Event Timeline
Log In to Comment