Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F62938270
kelvin.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
Thu, May 16, 15:56
Size
3 KB
Mime Type
text/x-c++
Expires
Sat, May 18, 15:56 (2 d)
Engine
blob
Format
Raw Data
Handle
17709958
Attached To
rTAMAAS tamaas
kelvin.cpp
View Options
/**
* @file
* @section LICENSE
*
* Copyright (©) 2016-19 EPFL (École Polytechnique Fédérale de Lausanne),
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "kelvin.hh"
#include "elasto_plastic_model.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_TAMAAS__
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* Constructors */
/* -------------------------------------------------------------------------- */
template <>
Kelvin<model_type::volume_2d, 0>::Kelvin(Model* model)
: VolumePotential(model) {
initialize(trait::components, trait::components);
}
template <>
Kelvin<model_type::volume_2d, 1>::Kelvin(Model* model)
: VolumePotential(model) {
initialize(trait::voigt, trait::components);
}
template <>
Kelvin<model_type::volume_2d, 2>::Kelvin(Model* model)
: VolumePotential(model) {
initialize(trait::voigt, trait::voigt);
}
/* -------------------------------------------------------------------------- */
/* Operator implementation */
/* -------------------------------------------------------------------------- */
template <model_type type, UInt derivative>
void Kelvin<type, derivative>::applyIf(GridBase<Real>& source,
GridBase<Real>& out,
filter_t pred) const {
Real nu = this->model->getPoissonRatio(), mu = this->model->getShearModulus();
influence::Kelvin<trait::dimension, derivative> kelvin(mu, nu);
detail::KelvinHelper<type, decltype(kelvin)> helper;
auto apply = [&](auto&& source_buffer, auto&& out_buffer) {
helper.applyIntegral(source_buffer, out_buffer, this->wavevectors,
this->model->getSystemSize().front(), kelvin);
helper.applyFreeTerm(source_buffer, out_buffer, kelvin);
helper.makeFundamentalGreatAgain(out_buffer);
};
this->fourierApplyIf(apply, source, out, pred);
}
/* -------------------------------------------------------------------------- */
/* Template instanciation */
/* -------------------------------------------------------------------------- */
template class Kelvin<model_type::volume_2d, 0>;
template class Kelvin<model_type::volume_2d, 1>;
template class Kelvin<model_type::volume_2d, 2>;
/* -------------------------------------------------------------------------- */
__END_TAMAAS__
Event Timeline
Log In to Comment