Files
CoolProp/dev/Tickets/1352.cpp
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

30 lines
1.1 KiB
C++

#include "crossplatform_shared_ptr.h"
#include <AbstractState.h>
#include <CoolProp.h>
int main(int argc, const char* argv[]) {
shared_ptr<CoolProp::AbstractState> pState;
pState.reset(CoolProp::AbstractState::factory("HEOS", "Water"));
double T_test = 25 + 273.15;
pState->update(CoolProp::QT_INPUTS, 0.3, T_test);
double rho_test = pState->rhomass();
double s_test = pState->smass();
double drho_new = 0;
pState->specify_phase(CoolProp::iphase_not_imposed);
pState->update(CoolProp::SmassT_INPUTS, s_test, T_test);
drho_new = pState->rhomass() - rho_test;
pState->specify_phase(CoolProp::iphase_not_imposed);
pState->update(CoolProp::DmassT_INPUTS, rho_test, T_test);
drho_new = pState->rhomass() - rho_test;
pState->specify_phase(CoolProp::iphase_twophase);
pState->update(CoolProp::SmassT_INPUTS, s_test, T_test);
drho_new = pState->rhomass() - rho_test;
pState->specify_phase(CoolProp::iphase_twophase);
pState->update(CoolProp::DmassT_INPUTS, rho_test, T_test);
drho_new = pState->rhomass() - rho_test;
}