HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Loading...
Searching...
No Matches
TestCaseNonLinearity.hpp
Go to the documentation of this file.
1// Class to provide a non-linear function
2
3//
4//
5// Author: Jerome Droniou (jerome.droniou@monash.edu)
6//
7
8/*
9*
10* This library was developed around HHO methods, although some parts of it have a more
11* general purpose. If you use this code or part of it in a scientific publication,
12* please mention the following book as a reference for the underlying principles
13* of HHO schemes:
14*
15* The Hybrid High-Order Method for Polytopal Meshes: Design, Analysis, and Applications.
16* D. A. Di Pietro and J. Droniou. 2019, 516p.
17* url: https://hal.archives-ouvertes.fr/hal-02151813.
18*
19*/
20
21
22#ifndef _TEST_CASE_NONLINEARITY_HPP
23#define _TEST_CASE_NONLINEARITY_HPP
24
25#include <functional>
26#include <string>
27
28namespace HArDCore2D {}
29
30using namespace HArDCore2D;
31
37// ----------------------------------------------------------------------------
38// Class definition
39// ----------------------------------------------------------------------------
40
41// @addtogroup TestCases
43
46
47public:
48 using nonlinearity_function_type = std::function<double(double,std::string)>;
49
52 const int iTCNL,
53 const double m=1.0
54 );
55
57 double nonlinearity(
58 const double s,
59 const std::string type
60 );
61
62private:
63 // id of test case
64 const int m_iTCNL;
65 // PME nonlinearity
66 const int m_m;
67
68 // Sign function
69 double sign(const double s) const {
70 double val = 0;
71 if (s>0){
72 val = 1;
73 }else if (s<0){
74 val = -1;
75 }
76 return val;
77 };
78
79};
80
81
83
84#endif //_TEST_CASE_NONLINEARITY_HPP
The TestCaseNonLinearity class provides definition of a nonlinear function, and related functions.
Definition TestCaseNonLinearity.hpp:45
std::function< double(double, std::string)> nonlinearity_function_type
type for nonlinear function
Definition TestCaseNonLinearity.hpp:48
double nonlinearity(const double s, const std::string type)
Nonlinearity.
Definition TestCaseNonLinearity.cpp:25
Definition ddr-klplate.hpp:27