Files
CoolProp/dev/fitter/DataTypes.h
Julien Marrec 05c8cf503b Lint: use automated tooling to reformat C++ and CMakeLists files (#2103)
* Add initial clang tidy / clang format config files

* Clang format the entire codebase

```
find ./src -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./include -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./Web -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./dev -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./wrappers -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
```

* Add a .cmake-format file and reformat CmakeLists.txt with it

https://github.com/cheshirekow/cmake_format

* Add a clang-format workflow


only runs on PRs, only on touched files
2022-03-31 10:51:48 -04:00

60 lines
1.9 KiB
C++

#ifndef FITTER_DATATYPES_H
#define FITTER_DATATYPES_H
class ExperimentalDataPoint
{
public:
EOSFitter* EOS;
double T, /// The temperature [K]
rho, /// The density [mol/m^3]
p, /// The pressure [Pa]
tau, /// The reciprocal reduced temperature [-]
delta, /// The reduced density [-]
log_tau, /// The natural logarithm of the reciprocal reduced temperature
log_delta, /// The natural logarithm of the reduced density
variance; /// The total variance of the datapoint
virtual double residual(const std::vector<double>& n) = 0;
double sum_squares(const std::vector<double>& n) {
return pow(residual(n) / variance, (int)2);
}
};
class NonlinearExperimentalDataPoint : public ExperimentalDataPoint
{
public:
virtual double a_0(const std::vector<double>& n) = 0;
virtual double a_i(int i) = 0;
double residual(const std::vector<double>& n);
};
class LinearExperimentalDataPoint : public ExperimentalDataPoint
{
public:
virtual double a_0(void) = 0;
virtual double a_i(int i) = 0;
double residual(const std::vector<double>& n);
};
class PressureDataPoint : public LinearExperimentalDataPoint
{
public:
PressureDataPoint(EOSFitter* EOS, double T, double rho, double p, double variance);
/// The part that does not depend on the coefficients
double a_0(void);
/// The part that multiplies the coefficients
double a_i(int i);
};
class SpecificHeatCPDataPoint : public NonlinearExperimentalDataPoint
{
public:
double cp, cp_over_R;
SpecificHeatCPDataPoint(EOSFitter* EOS, double T, double rho, double cp, double variance);
/// The part that does not depend on the coefficients
/// Here it requires that the coefficients be passed in to calculate the precorrelation factor
double a_0(const std::vector<double>& n);
/// The part that multiplies the coefficients
double a_i(int i);
};
#endif