Newer
Older
#ifndef NONLINCF_H
#define NONLINCF_H
#include <fem.hpp>
#include <solve.hpp>
#include <ngstd.hpp>
#include <vector>
#include <cmath>
#include <memory>
#include <iostream>
#include <cmath>
#include <cstring>
#include "../basicClasses/ngData_class.h"
#include "../basicClasses/magCurve.h"
using namespace ngstd;
using namespace ngfem;
using namespace ngsolve;
using namespace ngcomp;
// #define _Pi 3.141592653589793
template <unsigned int DIM>
std::pair<unsigned int, unsigned int> findNearestNeighbour(const vector<vector<MappedIntegrationPoint<DIM, DIM>> > & mips, const BaseMappedIntegrationPoint& mip);
template <unsigned int DIM>
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class nonLinCF:public CoefficientFunction
{
public:
nonLinCF(shared_ptr<MeshAccess>& mesh, IntegrationRule& intrule,
const shared_ptr<CoefficientFunction>& ptrInput,
vector<double> H_KL,
vector<double> B_KL,
const std::string cFieldIn="H", const std::string cFieldOut="B", const shared_ptr<CoefficientFunction>& ptrMask=nullptr, unsigned int order=1);
~nonLinCF() = default;
bool HasConverged(double aMeanError, double aMaxError) const;
void Update();
unsigned int getOrder() const;
KL GetKL();
virtual double Evaluate(const BaseMappedIntegrationPoint& mip) const override;
shared_ptr<CoefficientFunction> GetInputCF();
private:
shared_ptr<CoefficientFunction> ptrInput;
const std::string sFieldIn;
const std::string sFieldOut;
shared_ptr<CoefficientFunction> ptrMask;

Valentin Hanser
committed
shared_ptr<ngScalar_class<DIM>> ptrData;
vector<vector<MappedIntegrationPoint<DIM, DIM>> > mips;