Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F87032531
bodyforce_bc.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
Thu, Oct 10, 03:17
Size
2 KB
Mime Type
text/x-c
Expires
Sat, Oct 12, 03:17 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21524210
Attached To
rAKA akantu
bodyforce_bc.cc
View Options
/**
* @file predefined_bc.cc
*
* @author Zineb Fouad <zineb.fouad@epfl.ch>
* @author Nicolas Richart <nicolas.richart@epfl.ch>
*
* @date creation: Wed Aug 04 2010
* @date last modification: Wed Feb 06 2019
*
* @brief Example showing how to set boundary conditions
*
*
* @section LICENSE
*
* Copyright (©) 2015-2021 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 "non_linear_solver.hh"
#include "solid_mechanics_model.hh"
/* -------------------------------------------------------------------------- */
#include <iostream>
/* -------------------------------------------------------------------------- */
using
namespace
akantu
;
int
main
(
int
argc
,
char
*
argv
[])
{
initialize
(
"material.dat"
,
argc
,
argv
);
Mesh
mesh
(
2
);
mesh
.
read
(
"square.msh"
);
// model initialization
SolidMechanicsModel
model
(
mesh
);
model
.
initFull
(
_analysis_method
=
_static
);
// Dirichlet boundary conditions
model
.
applyBC
(
BC
::
Dirichlet
::
FixedValue
(
0.0
,
_x
),
"Fixed_y"
);
model
.
applyBC
(
BC
::
Dirichlet
::
FixedValue
(
0.0
,
_y
),
"Fixed_y"
);
//Body force boundary conditions
Vector
<
Real
>
gravity
(
2
);
gravity
(
1
)
=
1.
;
model
.
applyBC
(
BC
::
BodyForce
::
BodyForceFunctor
(
gravity
),
"steel"
);
auto
&
solver
=
model
.
getNonLinearSolver
();
solver
.
set
(
"max_iterations"
,
2
);
solver
.
set
(
"threshold"
,
2e-4
);
solver
.
set
(
"convergence_type"
,
SolveConvergenceCriteria
::
_solution
);
model
.
solveStep
();
// output in a paraview file
model
.
setBaseName
(
"plate"
);
model
.
addDumpFieldVector
(
"displacement"
);
model
.
addDumpField
(
"blocked_dofs"
);
model
.
addDumpField
(
"external_force"
);
model
.
addDumpField
(
"internal_force"
);
model
.
dump
();
finalize
();
return
EXIT_SUCCESS
;
}
Event Timeline
Log In to Comment