Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63819861
test_rough_surface.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
Wed, May 22, 17:03
Size
2 KB
Mime Type
text/x-c
Expires
Fri, May 24, 17:03 (2 d)
Engine
blob
Format
Raw Data
Handle
17820389
Attached To
rTAMAAS tamaas
test_rough_surface.cpp
View Options
/*
* SPDX-License-Indentifier: AGPL-3.0-or-later
*
* Copyright (©) 2016-2022 EPFL (École Polytechnique Fédérale de Lausanne),
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
* Copyright (©) 2020-2022 Lucas Frérot
*
* 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 "tamaas.hh"
#include "isopowerlaw.hh"
#include "surface_generator_filter.hh"
#include "polonsky_keer_rey.hh"
#include "model_factory.hh"
/* -------------------------------------------------------------------------- */
using namespace tamaas;
int main() {
/// Surface parameters
UInt grid_size = 512;
const UInt k0 = 4, k1 = 4, k2 = 32;
const Real hurst = 0.8;
/// Surface generation (2D)
SurfaceGeneratorFilter<2> sg;
sg.setSizes({{grid_size, grid_size}});
sg.setRandomSeed(0);
auto iso = std::make_shared<Isopowerlaw<2>>();
iso->setQ0(k0);
iso->setQ1(k1);
iso->setQ2(k2);
iso->setHurst(hurst);
sg.setSpectrum(iso);
std::cout << "Building rough surface with properties\n"
<< " Q0 = " << k0 << '\n'
<< " Q1 = " << k1 << '\n'
<< " Q2 = " << k2 << '\n'
<< " Hurst = " << hurst << '\n'
<< " size = " << grid_size << 'x' << grid_size << std::endl;
/// Making surface
GridBase<Real> & grid = sg.buildSurface();
std::cout << "Creating model" << std::endl;
/// Model initialization
std::unique_ptr<Model> model{ModelFactory::createModel(
model_type::basic_2d, {1., 1.}, {grid_size, grid_size})};
Real load = 0.1;
Real precision = 1e-12;
std::cout << "Solving contact problem" << std::endl;
/// Solve normal contact problem
PolonskyKeerRey solver{*model, grid, precision, PolonskyKeerRey::pressure,
PolonskyKeerRey::pressure};
solver.solve(load);
std::cout << "Finished" << std::endl;
return EXIT_SUCCESS;
}
Event Timeline
Log In to Comment