Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78662300
Iterate.hpp
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
Thu, Aug 22, 06:30
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Aug 24, 06:30 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20082661
Attached To
rGOOSEFEM GooseFEM
Iterate.hpp
View Options
/**
\file
\copyright Copyright 2017. Tom de Geus. All rights reserved.
\license This project is released under the GNU Public License (GPLv3).
*/
#ifndef PYGOOSEFEM_ITERATE_H
#define PYGOOSEFEM_ITERATE_H
#include <GooseFEM/Iterate.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
void init_Iterate(py::module& mod)
{
py::class_<GooseFEM::Iterate::StopList> cls(mod, "Iterate");
cls.def(py::init<size_t>(),
"Class to perform a residual check based on the last 'n' iterations."
"See :cpp:class:`GooseFEM::Iterate::StopList`.",
py::arg("n") = 1);
cls.def("reset",
py::overload_cast<>(&GooseFEM::Iterate::StopList::reset),
"Reset."
"See :cpp:func:`GooseFEM::Iterate::StopList::reset`.");
cls.def("stop_simple",
&GooseFEM::Iterate::StopList::stop_simple,
"Update list of residuals, return `true` if all residuals are below the tolerance."
"See :cpp:func:`GooseFEM::Iterate::StopList::stop_simple`.",
py::arg("res"),
py::arg("tol"));
cls.def("stop",
&GooseFEM::Iterate::StopList::stop,
"Update list of residuals, return `true` if all residuals are sorted and below the tolerance."
"See :cpp:func:`GooseFEM::Iterate::StopList::stop`.",
py::arg("res"),
py::arg("tol"));
cls.def("get",
&GooseFEM::Iterate::StopList::get,
"Get the list of residuals."
"See :cpp:func:`GooseFEM::Iterate::StopList::get`.");
cls.def("__repr__", [](const GooseFEM::Iterate::StopList&) { return "<GooseFEM.Iterate.StopList>"; });
}
#endif
Event Timeline
Log In to Comment