diff --git a/src/surface/isopowerlaw.cpp b/src/surface/isopowerlaw.cpp index 16a588f..5c863e4 100644 --- a/src/surface/isopowerlaw.cpp +++ b/src/surface/isopowerlaw.cpp @@ -1,109 +1,111 @@ /** * @file * * @author Lucas Frérot * * @section LICENSE * * Copyright (©) 2016 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 . * */ /* -------------------------------------------------------------------------- */ #include "isopowerlaw.hh" #include "fftransform.hh" #include /* -------------------------------------------------------------------------- */ __BEGIN_TAMAAS__ template void Isopowerlaw::computeFilter( GridHermitian& filter_coefficients) const { auto wavevectors = FFTransform::template computeFrequencies( filter_coefficients.sizes()); auto end = wavevectors.end(dim); - Loop::stridedLoop([this](Complex & coeff, VectorProxy&& q) { - coeff = (*this)(q); - }, filter_coefficients, wavevectors); + Loop::stridedLoop( + [this] CUDA_LAMBDA(Complex & coeff, VectorProxy && q) { + coeff = (*this)(q); + }, + filter_coefficients, wavevectors); } /* -------------------------------------------------------------------------- */ template Real Isopowerlaw::rmsHeights() const { return std::sqrt(M_PI * ((hurst + 1) / hurst * q1 * q1 - 1. / hurst * std::pow(q1, 2 * (hurst + 1)) * std::pow(q2, -2 * hurst) - q0 * q0)); } /* -------------------------------------------------------------------------- */ /** * Analytical moments, cf. Yastrebov et al. (2015) * "From infinitesimal to full contact between rough surfaces: Evolution * of the contact area", appendix A */ template <> std::vector Isopowerlaw<2>::moments() const { std::map T; T[0] = 2 * M_PI; T[2] = M_PI; T[4] = 3 * M_PI / 4.; Real xi = q0 / q1; Real zeta = q2 / q1; std::vector moments; using namespace std; for (int q : {0, 2, 4}) { Real m = T[q] * pow(q1, q - 2 * hurst) * ((1 - pow(xi, q + 2)) / (q + 2) + (pow(zeta, q - 2 * hurst) - 1) / (q - 2 * hurst)); moments.push_back(m); } return moments; } template <> std::vector Isopowerlaw<1>::moments() const { TAMAAS_EXCEPTION("Moments have not been implemented for 1D surfaces"); } /* -------------------------------------------------------------------------- */ template Real Isopowerlaw::alpha() const { std::vector m = moments(); return m[0] * m[2] / (m[1] * m[1]); } /* -------------------------------------------------------------------------- */ template Real Isopowerlaw::rmsSlopes() const { std::vector m = moments(); return std::sqrt(2 * m[1]); } template class Isopowerlaw<1>; template class Isopowerlaw<2>; __END_TAMAAS__