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

26 lines
866 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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("TTSE&HEOS", "Water"));
std::cout << "T crit: " << pState->T_critical() << std::endl;
pState->update(CoolProp::QT_INPUTS, 0.2, 373.15);
double res = pState->first_two_phase_deriv_splined(CoolProp::iDmass, CoolProp::iHmass, CoolProp::iP, 0.3);
/*x, y1 = [], []
for Q in np.linspace(0, 0.3, steps) :
AS.update(CoolProp.PQ_INPUTS, 101325, Q)
x.append(AS.Q())
try :
y1.append(AS.first_two_phase_deriv_splined(CoolProp.iDmass, CoolProp.iHmass, CoolProp.iP, 0.3))
except Exception as e :
print e
y1.append(np.NAN)
break
plt.plot(x, y1, label = 'Two-phase (splined, tabular)', ls = '--', lw = 3)
´*/
}