Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120431729
mindlin.cpp
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
Fri, Jul 4, 08:18
Size
5 KB
Mime Type
text/x-c++
Expires
Sun, Jul 6, 08:18 (2 d)
Engine
blob
Format
Raw Data
Handle
27187982
Attached To
rTAMAAS tamaas
mindlin.cpp
View Options
/**
* @file
*
* @author Lucas Frérot <lucas.frerot@epfl.ch>
*
* @section LICENSE
*
* Copyright (©) 2017 EPFL (Ecole Polytechnique Fédérale de
* Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
* Solides)
*
* Tamaas 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.
*
* Tamaas 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 Tamaas. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "mindlin.hh"
#include "elasto_plastic_model.hh"
#include "influence.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_TAMAAS__
/* -------------------------------------------------------------------------- */
template <>
void Mindlin<model_type::volume_2d, 3>::apply(GridBase<Real>& source,
GridBase<Real>& out) const {
Real nu = model->getPoissonRatio(), mu = model->getShearModulus();
influence::Kelvin<trait::dimension, 1> kelvin(mu, nu);
influence::Kelvin<trait::dimension, 2> kelvin_strain(mu, nu);
influence::Boussinesq<trait::dimension, 0> boussinesq(mu, nu);
auto apply = [&](
UInt i, decltype(source_buffers)& source_buffers,
decltype(disp_buffer)& displacement) {
constexpr UInt dim = trait::dimension;
const Real L = this->model->getSystemSize().front();
const UInt N = this->model->getDiscretization().front();
const Real dl = L / (N - 1);
// Compute displacements u_i
displacement = 0;
/// Compute surface strains only once (dirty)
if (i == 0) {
surface_strains = 0;
Real dij = 0;
// Computing integral for first element
Loop::stridedLoop(
[&kelvin_strain, dij, dl](MatrixProxy<Complex, dim, dim>&& gradu,
MatrixProxy<Complex, dim, dim>&& f,
VectorProxy<const Real, dim - 1>&& q) {
influence::KelvinIntegrator<1>::integrate<0>(
gradu, f, kelvin_strain, q, dij, dl);
},
surface_strains, source_buffers[0], this->wavevectors);
// Computing integral for rest
for (UInt j = 1; j < N; ++j) {
dij = j * dl;
Loop::stridedLoop(
[&kelvin_strain, dij, dl](MatrixProxy<Complex, dim, dim>&& gradu,
MatrixProxy<Complex, dim, dim>&& f,
VectorProxy<const Real, dim - 1>&& q) {
// Cutoff
if (-q.l2norm() * std::abs(dij) < std::log(1e-2))
return;
influence::KelvinIntegrator<1>::integrate<1>(
gradu, f, kelvin_strain, q, dij, dl);
},
surface_strains, source_buffers[j], this->wavevectors);
}
}
// Computing influence of Kelvin kernel
for (UInt j : Loop::range(N)) {
const Real dij = j * dl - i * dl; // don't factorize!
auto& source = source_buffers[j];
#define POTENTIAL(yj_xi) \
Loop::stridedLoop( \
[&kelvin, dij, dl](VectorProxy<Complex, dim>&& u, \
MatrixProxy<Complex, dim, dim>&& f, \
VectorProxy<const Real, dim - 1>&& q) { \
/* Cutoff */ \
if (-q.l2norm() * std::abs(dij) < std::log(1e-2)) \
return; \
influence::KelvinIntegrator<1>::integrate<yj_xi>(u, f, kelvin, q, dij, \
dl); \
}, \
displacement, source, this->wavevectors)
if (j > i) {
POTENTIAL(1);
} else if (j == i) {
POTENTIAL(0);
} else {
POTENTIAL(-1);
}
#undef POTENTIAL
}
// Correcting for the tractions on the surface
Real xi = i * dl;
Loop::stridedLoop(
[&boussinesq, xi](VectorProxy<Complex, dim>&& u,
MatrixProxy<Complex, dim, dim>&& gradu,
VectorProxy<const Real, dim - 1>&& q) {
if (-q.l2norm() * std::abs(xi) < std::log(1e-2))
return;
boussinesq.apply(u, gradu, q, xi);
},
displacement, surface_strains, this->wavevectors);
// Setting fundamental frequency to zero
VectorProxy<Complex, dim> u_fundamental(displacement(0));
u_fundamental = 0;
};
this->fourierApply(apply, source, out);
}
/* -------------------------------------------------------------------------- */
template <model_type type, UInt tensor_order>
void Mindlin<type, tensor_order>::apply(GridBase<Real>& source,
GridBase<Real>& out) const {
TAMAAS_EXCEPTION("The requested operator has not been implemented");
}
/* -------------------------------------------------------------------------- */
/* Template instanciation */
/* -------------------------------------------------------------------------- */
template class Mindlin<model_type::volume_2d, 3>;
template class Mindlin<model_type::volume_2d, 4>;
/* -------------------------------------------------------------------------- */
__END_TAMAAS__
Event Timeline
Log In to Comment