Skip to content

Commit 519bd58

Browse files
authored
Merge pull request #24 from precice/nonlinear_solid_solver
Nonlinear solid solver
2 parents 5b8b928 + 2991d03 commit 519bd58

10 files changed

+2909
-16
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<img src="https://travis-ci.org/precice/dealii-adapter.svg?branch=master" alt="Build status">
44
</a>
55

6-
A coupled structural solver written with the C++ finite element library deal.II
6+
Coupled structural solvers written with the C++ finite element library deal.II. The coupled codes build on different deal.II tutorials:
7+
The linear-elastic solver is based on the step-8 tutorial, the nonlinear solver builds on previous work of Jean-Paul Pelteret and Andrew McBride in their deal.II code gallery program 'Quasi-Static Finite-Strain Compressible Elasticity.' Documentation for usage and application can be found in the source code, on the deal.II tutorial documentation and the dealii-adapter wiki pages.
78

89
## Start here
910
Our [wiki](https://github.com/precice/dealii-adapter/wiki) will help you start. If you are missing something, [let us know](https://www.precice.org/resources/#contact).

coupled_elasto_dynamics/coupled_elasto_dynamics.cc

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/* ---------------------------------------------------------------------
2-
* Copyright (c) 2018 - 2019 by the preCICE authors
3-
*
4-
* This file is part of the dealii-adapter for the coupling library
5-
* preCICE. Parts of this program are based on deal.II tutorial programs.
6-
*
7-
* This adapter is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU General Public License as published by
9-
* the Free Software Foundation, either version 3 of the License, or
10-
* (at your option) any later version. The full text of the license can
11-
* be found in the file LICENSE in the precice/dealii-adapter repository.
12-
* ---------------------------------------------------------------------
13-
*
14-
* Author: David Schneider 2018,2019
15-
*/
161
#include <deal.II/base/function.h>
172
#include <deal.II/base/parameter_handler.h>
183
#include <deal.II/base/quadrature_lib.h>
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
##
2+
# CMake script for the dealii-adapter:
3+
##
4+
5+
# Set the name of the project and target:
6+
SET(TARGET "nonlinear_solid_mechanics")
7+
8+
SET(TARGET_SRC
9+
${TARGET}.cc
10+
)
11+
12+
# To cleanup result files
13+
SET(CLEAN_UP_FILES
14+
# a custom list of globs, e.g. *.log *.vtk
15+
*.vtk
16+
)
17+
# Usually, you will not need to modify anything beyond this point...
18+
19+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
20+
21+
FIND_PACKAGE(deal.II 9.1.1 QUIET
22+
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
23+
)
24+
IF(NOT ${deal.II_FOUND})
25+
MESSAGE(FATAL_ERROR "\n"
26+
"*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n"
27+
"You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n"
28+
"or set an environment variable \"DEAL_II_DIR\" that contains this path."
29+
)
30+
ENDIF()
31+
32+
DEAL_II_INITIALIZE_CACHED_VARIABLES()
33+
34+
PROJECT(${TARGET} LANGUAGES CXX)
35+
36+
DEAL_II_INVOKE_AUTOPILOT()
37+
38+
FIND_PACKAGE(precice REQUIRED)
39+
TARGET_LINK_LIBRARIES(${TARGET} precice::precice)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
#ifndef COMPRESSIBLE_NEO_HOOK_MATERIAL_H
2+
#define COMPRESSIBLE_NEO_HOOK_MATERIAL_H
3+
4+
#include <deal.II/physics/elasticity/standard_tensors.h>
5+
6+
namespace Neo_Hook_Solid
7+
{
8+
using namespace dealii;
9+
/**
10+
* The Material_Compressible_Neo_Hook_One_Field class is nearly the same as in
11+
* the original work. The density has been added as additional parameter,
12+
* which is needed for time dependent problems.
13+
*/
14+
template <int dim, typename NumberType>
15+
class Material_Compressible_Neo_Hook_One_Field
16+
{
17+
public:
18+
Material_Compressible_Neo_Hook_One_Field(const double mu,
19+
const double nu,
20+
const double rho)
21+
: kappa((2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 - 2.0 * nu)))
22+
, c_1(mu / 2.0)
23+
, rho(rho)
24+
{
25+
Assert(kappa > 0, ExcInternalError());
26+
}
27+
28+
~Material_Compressible_Neo_Hook_One_Field()
29+
{}
30+
31+
NumberType
32+
get_Psi(const NumberType & det_F,
33+
const SymmetricTensor<2, dim, NumberType> &b_bar) const
34+
{
35+
return get_Psi_vol(det_F) + get_Psi_iso(b_bar);
36+
}
37+
38+
SymmetricTensor<2, dim, NumberType>
39+
get_tau(const NumberType & det_F,
40+
const SymmetricTensor<2, dim, NumberType> &b_bar)
41+
{
42+
return get_tau_vol(det_F) + get_tau_iso(b_bar);
43+
}
44+
45+
SymmetricTensor<4, dim, NumberType>
46+
get_Jc(const NumberType & det_F,
47+
const SymmetricTensor<2, dim, NumberType> &b_bar) const
48+
{
49+
return get_Jc_vol(det_F) + get_Jc_iso(b_bar);
50+
}
51+
52+
NumberType
53+
get_rho() const
54+
{
55+
return rho;
56+
}
57+
58+
private:
59+
const double kappa;
60+
const double c_1;
61+
const double rho;
62+
63+
NumberType
64+
get_Psi_vol(const NumberType &det_F) const
65+
{
66+
return (kappa / 4.0) * (det_F * det_F - 1.0 - 2.0 * std::log(det_F));
67+
}
68+
69+
NumberType
70+
get_Psi_iso(const SymmetricTensor<2, dim, NumberType> &b_bar) const
71+
{
72+
return c_1 * (trace(b_bar) - dim);
73+
}
74+
75+
NumberType
76+
get_dPsi_vol_dJ(const NumberType &det_F) const
77+
{
78+
return (kappa / 2.0) * (det_F - 1.0 / det_F);
79+
}
80+
81+
SymmetricTensor<2, dim, NumberType>
82+
get_tau_vol(const NumberType &det_F) const
83+
{
84+
return NumberType(get_dPsi_vol_dJ(det_F) * det_F) *
85+
Physics::Elasticity::StandardTensors<dim>::I;
86+
}
87+
88+
SymmetricTensor<2, dim, NumberType>
89+
get_tau_iso(const SymmetricTensor<2, dim, NumberType> &b_bar) const
90+
{
91+
return Physics::Elasticity::StandardTensors<dim>::dev_P *
92+
get_tau_bar(b_bar);
93+
}
94+
95+
SymmetricTensor<2, dim, NumberType>
96+
get_tau_bar(const SymmetricTensor<2, dim, NumberType> &b_bar) const
97+
{
98+
return 2.0 * c_1 * b_bar;
99+
}
100+
101+
NumberType
102+
get_d2Psi_vol_dJ2(const NumberType &det_F) const
103+
{
104+
return ((kappa / 2.0) * (1.0 + 1.0 / (det_F * det_F)));
105+
}
106+
107+
SymmetricTensor<4, dim, NumberType>
108+
get_Jc_vol(const NumberType &det_F) const
109+
{
110+
return det_F *
111+
((get_dPsi_vol_dJ(det_F) + det_F * get_d2Psi_vol_dJ2(det_F)) *
112+
Physics::Elasticity::StandardTensors<dim>::IxI -
113+
(2.0 * get_dPsi_vol_dJ(det_F)) *
114+
Physics::Elasticity::StandardTensors<dim>::S);
115+
}
116+
117+
SymmetricTensor<4, dim, NumberType>
118+
get_Jc_iso(const SymmetricTensor<2, dim, NumberType> &b_bar) const
119+
{
120+
const SymmetricTensor<2, dim> tau_bar = get_tau_bar(b_bar);
121+
const SymmetricTensor<2, dim> tau_iso = get_tau_iso(b_bar);
122+
const SymmetricTensor<4, dim> tau_iso_x_I =
123+
outer_product(tau_iso, Physics::Elasticity::StandardTensors<dim>::I);
124+
const SymmetricTensor<4, dim> I_x_tau_iso =
125+
outer_product(Physics::Elasticity::StandardTensors<dim>::I, tau_iso);
126+
const SymmetricTensor<4, dim> c_bar = get_c_bar();
127+
128+
return (2.0 / dim) * trace(tau_bar) *
129+
Physics::Elasticity::StandardTensors<dim>::dev_P -
130+
(2.0 / dim) * (tau_iso_x_I + I_x_tau_iso) +
131+
Physics::Elasticity::StandardTensors<dim>::dev_P * c_bar *
132+
Physics::Elasticity::StandardTensors<dim>::dev_P;
133+
}
134+
135+
SymmetricTensor<4, dim, double>
136+
get_c_bar() const
137+
{
138+
return SymmetricTensor<4, dim>();
139+
}
140+
};
141+
} // namespace Neo_Hook_Solid
142+
#endif // COMPRESSIBLE_NEO_HOOK_MATERIAL_H

0 commit comments

Comments
 (0)