Page MenuHomec4science

rough_surface.cc
No OneTemporary

File Metadata

Created
Fri, May 31, 01:14

rough_surface.cc

/**
*
* @author Lucas Frérot <lucas.frerot@epfl.ch>
*
* @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 <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "tamaas.hh"
#include "bem_polonski.hh"
#include "surface_generator_filter_fft.hh"
/* -------------------------------------------------------------------------- */
using namespace tamaas;
int main(int argc, char * argv[]) {
/// Surface parameters
UInt grid_size = 512;
const UInt k0 = 4, k1 = 4, k2 = 32;
const Real hurst = 0.8;
const Real rms = 0.1;
/// Initialize Tamaas
initialize();
/// Surface generation
SurfaceGeneratorFilterFFT sg;
sg.getGridSize() = grid_size;
sg.getQ0() = k0;
sg.getQ1() = k1;
sg.getQ2() = k2;
sg.getRMS() = rms;
sg.getHurst() = hurst;
sg.getRandomSeed() = 56;
sg.Init();
Grid<Real, 2> & grid = sg.buildSurface();
/// Deprecated soon
Surface<Real> surface(grid_size, 1.);
surface.copy(grid);
std::cout << grid(0, 0, 0, 0) << std::endl;
/// Bem initialization
BemPolonski bem(surface);
bem.setEffectiveModulus(1.);
Real load = 0.1;
Real precision = 1e-12;
/// Solve normal contact problem
bem.computeEquilibrium(precision, load);
/// Cleanup Tamaas
finalize();
return EXIT_SUCCESS;
}

Event Timeline