2#define protected public
4#include "../mecacell/mecacell.h"
11bool doubleEq(
double a,
double b) {
return abs(a - b) < 0.000000001; }
22 for (
size_t c = 0; c < w0.cells.size(); ++c) {
23 REQUIRE(w0.cells[c]->id == w1.cells[c]->id);
24 REQUIRE(w0.cells[c]->getPosition() == w1.cells[c]->getPosition());
25 REQUIRE(w0.cells[c]->getVelocity() == w1.cells[c]->getVelocity());
26 REQUIRE(w0.cells[c]->getForce() == w1.cells[c]->getForce());
27 REQUIRE(w0.cells[c]->getExternalForces() == w1.cells[c]->getExternalForces());
28 REQUIRE(w0.cells[c]->getConnectedCells().size() ==
29 w1.cells[c]->getConnectedCells().size());
30 auto connected = w0.cells[c]->getConnectedCells();
31 for (
const auto& other : connected) {
32 bool sameConnections =
false;
33 for (
auto& other1 : w1.cells[c]->getConnectedCells()) {
34 if (other1->id == other->id) {
35 sameConnections =
true;
47 for (
auto& c : w.cells) {
51 for (
auto& co : c->connectedCells)
55 for (
auto& co : c->membrane.cccm.cellConnections) {
56 std::cerr <<
" |> Connection " << co <<
" btwn " << co->c0->id <<
" & "
62 for (
auto& co : w.cellCellConnections) {
64 << co.second->c0->id <<
" & " << co.second->c1->id <<
RESET <<
std::endl;
68TEST_CASE(
"World creation, cell additions & deletion") {
84 REQUIRE(w.cells[1]->getPosition() == secondCellPos);
Basis for every cell a user might want to use.
general purpose 3D vector/point class.
Where "everything" happens.
size_t getNbUpdates() const
get the number of update since the creation of the world
void update()
main update method
void addCell(Cell *c)
adds a cell to the new cells batch (which will be added to the main cells container at the end of the...
double getAdhesionWith(const VolCell *, const MecaCell::Vec &) const
this file contains various miscellanious utility functions & helpers *
const static constexpr char YELLOW[]
const static constexpr char BOLDYELLOW[]
const static constexpr char BOLDBLUE[]
const static constexpr char RESET[]
int abs(int x)
Computes the absolute value of an integer.
iostream cerr
Standard error stream.
iostream endl
End-of-line manipulator.
TEST_CASE("World creation, cell additions & deletion")
bool doubleEq(double a, double b)
void checkThatWorldssAreIdentical(W &w0, W &w1)