Commit 6bb91962 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[appl] speed up runtime for testing

We allow for passing the number of entities to be created via the
command line, such that this can be used in the test suite to speedup
computations.
parent 2d774f43
frackit_add_test(NAME example3
SOURCES example3.cc
COMPILE_DEFINITIONS BREPFILE="layers.brep"
LABELS example)
LABELS example
CMD_ARGS 3)
frackit_symlink_or_copy(FILES example3.py layers.brep)
......
......@@ -159,9 +159,12 @@ int main(int argc, char** argv)
// Helper class for terminal output of the creation
// progress and definition of stop criterion etc
// Check if a value has been passed via the command line,
// otherwise use the defaults. This is used in the test suite
// to speed up testing time.
SamplingStatus status;
status.setTargetCount(diskSetId, 12); // we want 11 entities of orientation 1
status.setTargetCount(quadSetId, 16); // we want 13 entities of orientation 2
status.setTargetCount(diskSetId, (argc > 1 ? std::stoi(argv[1]) : 12)); // we want 11 entities of orientation 1
status.setTargetCount(quadSetId, (argc > 1 ? std::stoi(argv[1]) : 16)); // we want 13 entities of orientation 2
// The actual network generation loop
ctype containedNetworkArea = 0.0;
......
frackit_add_test(NAME example4
SOURCES example4.cc
LABELS example)
LABELS example
COMMAND ./example4
CMD_ARGS 5)
frackit_symlink_or_copy(FILES example4.py)
......
......@@ -5,6 +5,7 @@
#include <vector>
#include <cmath>
#include <chrono>
#include <string>
// utility functions
#include <frackit/common/math.hh>
......@@ -198,7 +199,9 @@ int main(int argc, char** argv)
///////////////////////////
// 4. Network generation //
///////////////////////////
const std::size_t numTargetEntities = 75;
// allow passing number of entities via command line. This is used in the
// test suite in order to speed up testing time
const std::size_t numTargetEntities = argc > 1 ? std::stoi(argv[1]) : 75;
std::vector<TopoDS_Face> entitiesSet1; entitiesSet1.reserve(numTargetEntities);
std::vector<TopoDS_Face> entitiesSet2; entitiesSet2.reserve(numTargetEntities);
std::vector<TopoDS_Face> entitiesSet3; entitiesSet3.reserve(numTargetEntities);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment