PLaSK library
Loading...
Searching...
No Matches
brent.hpp
Go to the documentation of this file.
1/*
2 * This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3 * Copyright (c) 2022 Lodz University of Technology
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#ifndef PLASK__OPTICAL_EFFECTIVE_BRENT_H
15#define PLASK__OPTICAL_EFFECTIVE_BRENT_H
16
17#include "rootdigger.hpp"
18#include "solver.hpp"
19
20namespace plask { namespace optical { namespace modal {
21
22class RootBrent: public RootDigger {
23
24 // Write log message
25 template <typename... Args>
26 void writelog(LogLevel level, const std::string& msg, Args&&... args) const {
27 std::string prefix = solver.getId(); prefix += ": "; prefix += log_value.chartName(); prefix += ": ";
28 plask::writelog(level, prefix + msg, std::forward<Args>(args)...);
29 }
30
31 protected:
32
33 double axisBrent(dcomplex start, double& fx, bool real, int& counter);
34
35 public:
36
37 // Constructor
38 RootBrent(ModalBase& solver, const function_type& val_fun, const Params& pars, const char* name):
39 RootDigger(solver, val_fun, pars, name) {}
40
41
42 dcomplex find(dcomplex start) override;
43};
44
45}}} // namespace plask::optical::modal
46#endif // PLASK__OPTICAL_EFFECTIVE_BRENT_H