Jpp test-rotations-old-533-g2bdbdb559
the software that should make you happy
Loading...
Searching...
No Matches
JSeaWater.cc File Reference
#include <string>
#include <iostream>
#include <cmath>
#include "JPhysics/JSeaWater.hh"
#include "JLang/JManip.hh"
#include "Jeep/JParser.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 32 of file JSeaWater.cc.

33{
34 using namespace std;
35 using namespace JPP;
36
37 double precision;
38 int debug;
39
40 try {
41
42 JParser<> zap;
43
44 zap['p'] = make_field(precision) = 1.0e-10;
45 zap['d'] = make_field(debug) = 3;
46
47 zap(argc, argv);
48 }
49 catch(const exception &error) {
50 FATAL(error.what() << endl);
51 }
52
53
54 {
55 double F = 0.0;
56
57#ifndef RADIATION
58 const auto buffer = { JSeaWater::O, JSeaWater::H, JSeaWater::Na, JSeaWater::Cl };
59#else
60 const auto buffer = { JSeaWater::O, JSeaWater::H, JSeaWater::Na, JSeaWater::Cl, JSeaWater::Ca, JSeaWater::Mg, JSeaWater::K, JSeaWater::S };
61#endif
62 for (const auto& i : buffer) {
63
64 cout << i << endl;
65
66 F += i.f;
67 }
68
69 ASSERT(fabs(F - 1.0) <= precision, "Test total mass fraction " << SCIENTIFIC(12,3) << (F - 1.0));
70 }
71}
#define ASSERT(A,...)
Assert macro.
Definition JMessage.hh:90
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition JManip.hh:488