Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F70580437
integrator.hh
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
Sun, Jul 7, 13:58
Size
2 KB
Mime Type
text/x-c++
Expires
Tue, Jul 9, 13:58 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18863320
Attached To
rTAMAAS tamaas
integrator.hh
View Options
/**
* @file
* @section LICENSE
*
* Copyright (©) 2016-2020 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/>.
*
*/
/* -------------------------------------------------------------------------- */
#ifndef INTEGRATOR_HH
#define INTEGRATOR_HH
/* -------------------------------------------------------------------------- */
#include "element.hh"
#include <expolit/expolit>
/* -------------------------------------------------------------------------- */
namespace tamaas {
template <UInt interpolation_order>
class Integrator {
using element = ExponentialElement<interpolation_order>;
static constexpr std::pair<Real, Real> bounds{-1, 1};
public:
/// Standard integral of \f$\exp(\pm qy) \phi(y)\f$ over an element of radius
/// \f$r\f$ and center \f$x_c\f$
template <bool upper, UInt shape>
static Real G0(Real q, Real r, Real xc) {
const auto F = element::template g0<upper, shape>(q * r);
return r * std::exp(element::sign(upper) * q * xc) *
expolit::definite_integral(bounds, F);
}
/// Standard integral of \f$qy\exp(\pm qy) \phi(y)\f$ over an element of
/// radius \f$r\f$ and center \f$x_c\f$
template <bool upper, UInt shape>
static Real G1(Real q, Real r, Real xc) {
const auto c = q * r;
const auto integrals =
std::make_pair(element::template g0<upper, shape>(c),
element::template g1<upper, shape>(c));
return r * std::exp(element::sign(upper) * q * xc) *
(q * xc * expolit::definite_integral(bounds, integrals.first) +
expolit::definite_integral(bounds, integrals.second));
}
/// Standard integral of \f$\phi(y)\f$ over an element of radius
/// \f$r\f$ and center \f$x_c\f$. Used for fundamental mode
template <UInt shape>
constexpr static Real F(Real r) {
return r * expolit::definite_integral(bounds, element::shapes[shape]);
}
};
// static member declare
template <UInt interpolation_order>
constexpr std::pair<Real, Real> Integrator<interpolation_order>::bounds;
} // namespace tamaas
#endif // INTEGRATOR_HH
Event Timeline
Log In to Comment