Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81433122
small_case.cc
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
Fri, Sep 6, 01:24
Size
2 KB
Mime Type
text/x-c
Expires
Sun, Sep 8, 01:24 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20563481
Attached To
rMUSPECTRE µSpectre
small_case.cc
View Options
/**
* file small_case.cc
*
* @author Till Junge <till.junge@epfl.ch>
*
* @date 12 Jan 2018
*
* @brief small case for debugging
*
* @section LICENCE
*
* Copyright © 2018 Till Junge
*
* µSpectre is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3, or (at
* your option) any later version.
*
* µSpectre 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "common/common.hh"
#include "common/iterators.hh"
#include "system/system_factory.hh"
#include "materials/material_hyper_elastic1.hh"
#include "solver/solvers.hh"
#include <iostream>
using namespace muSpectre;
int main()
{
constexpr Dim_t dim{twoD};
Ccoord_t<dim> resolution{3, 3};
Rcoord_t<dim> lengths{CcoordOps::get_cube<dim>(3.)};//{5.2e-9, 8.3e-9, 8.3e-9};
Formulation form{Formulation::finite_strain};
auto rve{make_system(resolution,
lengths,
form)};
auto & hard{MaterialHyperElastic1<dim, dim>::make
(rve, "hard", 210e9, .33)};
auto & soft{MaterialHyperElastic1<dim, dim>::make
(rve, "soft", 70e9, .33)};
for (auto && tup: akantu::enumerate(rve)) {
auto & i = std::get<0>(tup);
auto & pixel = std::get<1>(tup);
if (i < 3) {
hard.add_pixel(pixel);
} else {
soft.add_pixel(pixel);
}
}
rve.initialise();
Real tol{1e-6};
Grad_t<dim> Del0{};
Del0 << 0, .1,
0, 0;
Dim_t maxiter{31};
Dim_t verbose{3};
auto res = de_geus(rve, Del0, tol, tol, maxiter, verbose);
std::cout << res.grad.transpose() << std::endl;
return 0;
}
Event Timeline
Log In to Comment