60 for (
unsigned elem_idx = 0; elem_idx < rCellPopulation.
GetNumElements(); ++elem_idx)
62 unsigned num_nodes_this_elem = rCellPopulation.
GetElement(elem_idx)->GetNumNodes();
65 std::vector<unsigned> random_node_order;
66 random_node_order.reserve(num_nodes_this_elem);
67 for (
unsigned node_idx = 0; node_idx < num_nodes_this_elem; ++node_idx)
69 random_node_order.push_back(node_idx);
73 std::shuffle(random_node_order.begin(), random_node_order.end(), std::mt19937(std::random_device()()));
76 unsigned half_way = num_nodes_this_elem / 2;
77 for (
unsigned i = 0; i < half_way; ++i)
79 unsigned rand_node_a = random_node_order[2 * i];
80 unsigned rand_node_b = random_node_order[2 * i + 1];
82 c_vector<double, DIM> random_force;
83 for (
unsigned dim = 0; dim < DIM; ++dim)
94 random_force *= avg_magnitude;
103 for (
unsigned lam_idx = 0; lam_idx < rCellPopulation.
GetNumLaminas(); ++lam_idx)
105 unsigned num_nodes_this_elem = rCellPopulation.
GetLamina(lam_idx)->GetNumNodes();
108 std::vector<unsigned> random_node_order;
109 random_node_order.reserve(num_nodes_this_elem);
110 for (
unsigned node_idx = 0; node_idx < num_nodes_this_elem; ++node_idx)
112 random_node_order.push_back(node_idx);
116 std::shuffle(random_node_order.begin(), random_node_order.end(), std::mt19937(std::random_device()()));
119 unsigned half_way = num_nodes_this_elem / 2;
120 for (
unsigned i = 0; i < half_way; ++i)
122 unsigned rand_node_a = random_node_order[2 * i];
123 unsigned rand_node_b = random_node_order[2 * i + 1];
125 c_vector<double, DIM> random_force;
126 for (
unsigned dim = 0; dim < DIM; ++dim)
137 random_force *= avg_magnitude;
140 random_force *= -1.0;