MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / main

Function main

Tests/Parser/main.cpp:237–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237int main (int argc, char* argv[])
238{
239 amrex::Initialize(argc, argv);
240
241 {
242 amrex::Print() << "\n";
243 int nerror = 0;
244 nerror += test3("if( ((z-zc)*(z-zc)+(y-yc)*(y-yc)+(x-xc)*(x-xc))^(0.5) < (r_star-dR), 0.0, if(((z-zc)*(z-zc)+(y-yc)*(y-yc)+(x-xc)*(x-xc))^(0.5) <= r_star, dens, 0.0))",
245 {{"xc", 0.1}, {"yc", -1.0}, {"zc", 0.2}, {"r_star", 0.73}, {"dR", 0.57}, {"dens", 12.}},
246 {"x","y","z"},
247 [=] (double x, double y, double z) -> double {
248 double xc=0.1, yc=-1.0, zc=0.2, r_star=0.73, dR=0.57, dens=12.;
249 double r = std::sqrt((z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc));
250 if (r >= r_star-dR && r <= r_star) {
251 return dens;
252 } else {
253 return 0.0;
254 }
255 },
256 {-1., -1., -1.0}, {1.0, 1.0, 1.0}, 100,
257 1.e-12, 1.e-15);
258
259 nerror += test3("r=sqrt((z-zc)*(z-zc)+(y-yc)*(y-yc)+(x-xc)*(x-xc)); if(r < (r_star-dR), 0.0, if(r <= r_star, dens, 0.0))",
260 {{"xc", 0.1}, {"yc", -1.0}, {"zc", 0.2}, {"r_star", 0.73}, {"dR", 0.57}, {"dens", 12.}},
261 {"x","y","z"},
262 [=] (double x, double y, double z) -> double {
263 double xc=0.1, yc=-1.0, zc=0.2, r_star=0.73, dR=0.57, dens=12.;
264 double r = std::sqrt((z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc));
265 if (r >= r_star-dR && r <= r_star) {
266 return dens;
267 } else {
268 return 0.0;
269 }
270 },
271 {-1., -1., -1.0}, {1.0, 1.0, 1.0}, 100,
272 1.e-12, 1.e-15);
273
274 nerror += test3("r=(z-zc)*(z-zc)+(y-yc)*(y-yc)+(x-xc)*(x-xc); r=sqrt(r); if(r < (r_star-dR), 0.0, if(r <= r_star, dens, 0.0))",
275 {{"xc", 0.1}, {"yc", -1.0}, {"zc", 0.2}, {"r_star", 0.73}, {"dR", 0.57}, {"dens", 12.}},
276 {"x","y","z"},
277 [=] (double x, double y, double z) -> double {
278 double xc=0.1, yc=-1.0, zc=0.2, r_star=0.73, dR=0.57, dens=12.;
279 double r = std::sqrt((z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc));
280 if (r >= r_star-dR && r <= r_star) {
281 return dens;
282 } else {
283 return 0.0;
284 }
285 },
286 {-1., -1., -1.0}, {1.0, 1.0, 1.0}, 100,
287 1.e-12, 1.e-15);
288
289 nerror += test3("( ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))<=r_star) * ((( (z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc) )^(0.5))>=(r_star-dR)) )*dens",
290 {{"xc", 0.1}, {"yc", -1.0}, {"zc", 0.2}, {"r_star", 0.73}, {"dR", 0.57}, {"dens", 12.}},
291 {"x","y","z"},
292 [=] (double x, double y, double z) -> double {
293 double xc=0.1, yc=-1.0, zc=0.2, r_star=0.73, dR=0.57, dens=12.;
294 double r = std::sqrt((z-zc)*(z-zc) + (y-yc)*(y-yc) + (x-xc)*(x-xc));

Callers

nothing calls this directly

Calls 11

PrintClass · 0.85
test3Function · 0.85
test4Function · 0.85
test1Function · 0.85
AbortFunction · 0.85
InitializeFunction · 0.50
fFunction · 0.50
FinalizeFunction · 0.50
registerVariablesMethod · 0.45
setConstantMethod · 0.45

Tested by

no test coverage detected