Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80680598
static.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
Mon, Sep 2, 01:37
Size
2 KB
Mime Type
text/x-c
Expires
Wed, Sep 4, 01:37 (2 d)
Engine
blob
Format
Raw Data
Handle
20372915
Attached To
rAKA akantu
static.cc
View Options
/**
* Copyright (©) 2010-2023 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* This file is part of Akantu
*
* 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"
/* -------------------------------------------------------------------------- */
using
namespace
akantu
;
/* -------------------------------------------------------------------------- */
int
main
(
int
argc
,
char
*
argv
[])
{
initialize
(
"material.dat"
,
argc
,
argv
);
const
Int
spatial_dimension
=
2
;
Mesh
mesh
(
spatial_dimension
);
mesh
.
read
(
"square.msh"
);
SolidMechanicsModel
model
(
mesh
);
/// model initialization
model
.
initFull
(
_analysis_method
=
_static
);
/// configure dumper
model
.
setBaseName
(
"static"
);
model
.
addDumpFieldVector
(
"displacement"
);
model
.
addDumpField
(
"external_force"
);
model
.
addDumpField
(
"internal_force"
);
model
.
addDumpField
(
"blocked_dofs"
);
model
.
addDumpField
(
"grad_u"
);
model
.
addDumpField
(
"stress"
);
/// Dirichlet boundary conditions
model
.
applyBC
(
BC
::
Dirichlet
::
FixedValue
(
0.0
,
_x
),
"Fixed_x"
);
model
.
applyBC
(
BC
::
Dirichlet
::
FixedValue
(
0.0
,
_y
),
"Fixed_y"
);
model
.
applyBC
(
BC
::
Dirichlet
::
FixedValue
(
0.0001
,
_x
),
"Displacement"
);
model
.
dump
();
/// set the limits for the Newton-Raphson solver
auto
&
solver
=
model
.
getNonLinearSolver
();
solver
.
set
(
"max_iterations"
,
2
);
solver
.
set
(
"threshold"
,
2e-4
);
solver
.
set
(
"convergence_type"
,
SolveConvergenceCriteria
::
_solution
);
/// static solve
model
.
solveStep
();
model
.
dump
();
return
0
;
}
Event Timeline
Log In to Comment