MEDYAN  3.1
Software for simulating active matter dynamics
Output.cpp
Go to the documentation of this file.
1 
2 //------------------------------------------------------------------
3 // **MEDYAN** - Simulation Package for the Mechanochemical
4 // Dynamics of Active Networks, v3.1
5 //
6 // Copyright (2015-2016) Papoian Lab, University of Maryland
7 //
8 // ALL RIGHTS RESERVED
9 //
10 // See the MEDYAN web page for more information:
11 // http://www.medyan.org
12 //------------------------------------------------------------------
13 #include <cmath>
14 #include <algorithm>
15 
16 #include "Output.h"
17 
18 #include "SubSystem.h"
19 #include "CompartmentGrid.h"
20 
21 #include "Filament.h"
22 #include "Cylinder.h"
23 #include "Bead.h"
24 #include "Linker.h"
25 #include "MotorGhost.h"
26 #include "BranchingPoint.h"
27 #include "Bubble.h"
28 
29 #include "Boundary.h"
30 #include "CompartmentGrid.h"
31 #include "GController.h"
32 
33 #include "SysParams.h"
34 #include "MathFunctions.h"
35 
36 using namespace mathfunc;
37 
38 void BasicSnapshot::print(int snapshot) {
39 
40  _outputFile.precision(10);
41 
42  // print first line (snapshot number, time, number of filaments,
43  // linkers, motors, branchers, bubbles)
44  _outputFile << snapshot << " " << tau() << " " <<
45  Filament::numFilaments() << " " <<
46  Linker::numLinkers() << " " <<
47  MotorGhost::numMotorGhosts() << " " <<
49  Bubble::numBubbles() << endl;
50 
51  for(auto &filament : Filament::getFilaments()) {
52 
53  //print first line (Filament ID, type, length, left_delta, right_delta)
54  _outputFile << "FILAMENT " << filament->getID() << " " <<
55  filament->getType() << " " <<
56  filament->getCylinderVector().size() + 1 << " " <<
57  filament->getDeltaMinusEnd() << " " << filament->getDeltaPlusEnd() << endl;
58 
59  //print coordinates
60  for (auto cylinder : filament->getCylinderVector()){
61 
62  auto x = cylinder->getFirstBead()->coordinate;
63  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2]<<" ";
64 
65  }
66  //print last bead coord
67  auto x = filament->getCylinderVector().back()->getSecondBead()->coordinate;
68  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2];
69 
70  _outputFile << endl;
71 
72  //Reset deltas for this filament
73  filament->resetDeltaPlusEnd();
74  filament->resetDeltaMinusEnd();
75  }
76 
77 
78  for(auto &linker : Linker::getLinkers()) {
79 
80  //print first line
81  _outputFile << "LINKER " << linker->getID()<< " " <<
82  linker->getType() << endl;
83 
84  //print coordinates
85  auto x =
86  midPointCoordinate(linker->getFirstCylinder()->getFirstBead()->coordinate,
87  linker->getFirstCylinder()->getSecondBead()->coordinate,
88  linker->getFirstPosition());
89  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2] << " ";
90 
91  x = midPointCoordinate(linker->getSecondCylinder()->getFirstBead()->coordinate,
92  linker->getSecondCylinder()->getSecondBead()->coordinate,
93  linker->getSecondPosition());
94  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2];
95 
96  _outputFile << endl;
97  }
98 
99  for(auto &motor : MotorGhost::getMotorGhosts()) {
100 
101  //print first line
102  //also contains a Bound(1) or unbound(0) qualifier
103  _outputFile << "MOTOR " << motor->getID() << " " << motor->getType() << " " << 1 << endl;
104 
105  //print coordinates
106  auto x =
107  midPointCoordinate(motor->getFirstCylinder()->getFirstBead()->coordinate,
108  motor->getFirstCylinder()->getSecondBead()->coordinate,
109  motor->getFirstPosition());
110  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2] << " ";
111 
112  x = midPointCoordinate(motor->getSecondCylinder()->getFirstBead()->coordinate,
113  motor->getSecondCylinder()->getSecondBead()->coordinate,
114  motor->getSecondPosition());
115  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2];
116 
117  _outputFile << endl;
118  }
119 
120  //DEPRECATED AS OF 9/8/16
121 // //collect diffusing motors
122 // for(auto md: _subSystem->getCompartmentGrid()->getDiffusingMotors()) {
123 //
124 // int ID = get<0>(md);
125 // int type = get<1>(md);
126 //
127 // auto firstPoint = get<2>(md);
128 // auto secondPoint = get<3>(md);
129 //
130 // _outputFile << "MOTOR " << ID << " " << type << " " << 0 << endl;
131 //
132 // //print coordinates
133 // _outputFile<<firstPoint[0]<<" "<<firstPoint[1]<<" "<<firstPoint[2] << " ";
134 // _outputFile<<secondPoint[0]<<" "<<secondPoint[1]<<" "<<secondPoint[2];
135 //
136 // _outputFile << endl;
137 // }
138 
139  for(auto &branch : BranchingPoint::getBranchingPoints()) {
140 
141  //print first line
142  _outputFile << "BRANCHER " << branch->getID() << " " <<
143  branch->getType() << endl;
144 
145  //print coordinates
146  auto x = branch->coordinate;
147  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2] << endl;
148  }
149 
150  for(auto &bubble : Bubble::getBubbles()) {
151 
152  //print first line
153  _outputFile << "BUBBLE " << bubble->getID() << " " <<
154  bubble->getType() << endl;
155 
156  //print coordinates
157  auto x = bubble->coordinate;
158  _outputFile<<x[0]<<" "<<x[1]<<" "<<x[2] << endl;
159  }
160 
161  _outputFile <<endl;
162 }
163 
164 void BirthTimes::print(int snapshot) {
165 
166  _outputFile.precision(10);
167 
168  // print first line (snapshot number, time, number of filaments,
169  // linkers, motors, branchers, bubbles)
170  _outputFile << snapshot << " " << tau() << " " <<
171  Filament::numFilaments() << " " <<
172  Linker::numLinkers() << " " <<
173  MotorGhost::numMotorGhosts() << " " <<
175  Bubble::numBubbles() << endl;
176 
177  for(auto &filament : Filament::getFilaments()) {
178 
179  //print first line (Filament ID, type, length, left_delta, right_delta)
180  _outputFile << "FILAMENT " << filament->getID() << " " <<
181  filament->getType() << " " <<
182  filament->getCylinderVector().size() + 1 << " " <<
183  filament->getDeltaMinusEnd() << " " << filament->getDeltaPlusEnd() << endl;
184 
185  //print birth times
186  for (auto cylinder : filament->getCylinderVector()){
187 
188  auto b = cylinder->getFirstBead();
189  _outputFile<< b->getBirthTime() << " ";
190 
191  }
192  //last bead
193  _outputFile<< filament->getCylinderVector().back()
194  ->getSecondBead()->getBirthTime();
195  _outputFile << endl;
196  }
197  for(auto &linker : Linker::getLinkers()) {
198 
199  //print first line
200  _outputFile << "LINKER " << linker->getID()<< " " <<
201  linker->getType() << endl;
202 
203  //print birth times
204  _outputFile << linker->getBirthTime() << " " <<
205  linker->getBirthTime() << endl;
206  }
207 
208  for(auto &motor : MotorGhost::getMotorGhosts()) {
209 
210  //print first line
211  //also contains a Bound(1) or unbound(0) qualifier
212  _outputFile << "MOTOR " << motor->getID() << " " << motor->getType() << " " << 1 << endl;
213 
214  //print birth times
215  _outputFile << motor->getBirthTime() << " " <<
216  motor->getBirthTime() << endl;
217  }
218 
219  //DEPRECATED AS OF 9/8/16
220 //
221 // //collect diffusing motors
222 // for(auto md: _subSystem->getCompartmentGrid()->getDiffusingMotors()) {
223 //
224 // int ID = get<0>(md);
225 // int type = get<1>(md);
226 //
227 // auto firstPoint = get<2>(md);
228 // auto secondPoint = get<3>(md);
229 //
230 // _outputFile << "MOTOR " << ID << " " << type << " " << 0 << endl;
231 //
232 // //print coordinates
233 // //print birth times
234 // _outputFile << 0 << " " << 0 << endl;
235 // }
236 
237  for(auto &branch : BranchingPoint::getBranchingPoints()) {
238 
239  //print first line
240  _outputFile << "BRANCHER " << branch->getID() << " " <<
241  branch->getType() << endl;
242 
243  //print birth times
244  _outputFile << branch->getBirthTime() << endl;
245  }
246  for(auto &bubble : Bubble::getBubbles()) {
247 
248  //print first line
249  _outputFile << "BUBBLE " << bubble->getID() << " " <<
250  bubble->getType() << endl;
251 
252  //print birth times
253  _outputFile << bubble->getBead()->getBirthTime() << endl;
254  }
255 
256  _outputFile <<endl;
257 }
258 
259 void Forces::print(int snapshot) {
260 
261  _outputFile.precision(10);
262 
263  // print first line (snapshot number, time, number of filaments,
264  // linkers, motors, branchers)
265  _outputFile << snapshot << " " << tau() << " " <<
266  Filament::numFilaments() << " " <<
267  Linker::numLinkers() << " " <<
268  MotorGhost::numMotorGhosts() << " " <<
270  Bubble::numBubbles() << endl;
271 
272  for(auto &filament : Filament::getFilaments()) {
273 
274  //print first line (Filament ID, type, length, left_delta, right_delta
275  _outputFile << "FILAMENT " << filament->getID() << " " <<
276  filament->getType() << " " <<
277  filament->getCylinderVector().size() + 1 << " " <<
278  filament->getDeltaMinusEnd() << " " << filament->getDeltaPlusEnd() << endl;
279 
280  //print force
281  for (auto cylinder : filament->getCylinderVector()){
282 
283  double forceMag= cylinder->getFirstBead()->FDotF();
284  forceMag = sqrt(forceMag);
285  _outputFile<<forceMag << " ";
286 
287  }
288  //print last bead force
289  double forceMag = filament->getCylinderVector().back()->
290  getSecondBead()->FDotF();
291  forceMag = sqrt(forceMag);
292  _outputFile<<forceMag;
293 
294  _outputFile << endl;
295  }
296 
297  for(auto &linker : Linker::getLinkers()) {
298 
299  //print first line
300  _outputFile << "LINKER " << linker->getID()<< " " <<
301  linker->getType() << endl;
302 
303  //print stretch force
304  _outputFile << linker->getMLinker()->stretchForce << " " <<
305  linker->getMLinker()->stretchForce << endl;
306  }
307 
308  for(auto &motor : MotorGhost::getMotorGhosts()) {
309 
310  //print first line
311  //also contains a Bound(1) or unbound(0) qualifier
312  _outputFile << "MOTOR " << motor->getID() << " " << motor->getType() << " " << 1 << endl;
313 
314  //print stretch force
315  _outputFile << motor->getMMotorGhost()->stretchForce << " " <<
316  motor->getMMotorGhost()->stretchForce << endl;
317  }
318 
319  //DEPRECATED AS OF 9/8/16
320 // //collect diffusing motors
321 // for(auto md: _subSystem->getCompartmentGrid()->getDiffusingMotors()) {
322 //
323 // int ID = get<0>(md);
324 // int type = get<1>(md);
325 //
326 // auto firstPoint = get<2>(md);
327 // auto secondPoint = get<3>(md);
328 //
329 // _outputFile << "MOTOR " << ID << " " << type << " " << 0 << endl;
330 //
331 // //print coordinates
332 // //print birth times
333 // _outputFile << 0 << " " << 0 << endl;
334 // }
335 
336  for(auto &branch : BranchingPoint::getBranchingPoints()) {
337 
338  //print first line
339  _outputFile << "BRANCHER " << branch->getID() << " " <<
340  branch->getType() << endl;
341 
342  //Nothing for branchers
343  _outputFile << 0.0 << endl;
344  }
345  for(auto &bubble : Bubble::getBubbles()) {
346 
347  //print first line
348  _outputFile << "BUBBLE " << bubble->getID() << " " <<
349  bubble->getType() << endl;
350 
351  //Nothing for bubbles
352  _outputFile << 0.0 << endl;
353  }
354 
355  _outputFile <<endl;
356 }
357 
358 
359 void Tensions::print(int snapshot) {
360 
361  _outputFile.precision(10);
362 
363  // print first line (snapshot number, time, number of filaments,
364  // linkers, motors, branchers)
365  _outputFile << snapshot << " " << tau() << " " <<
366  Filament::numFilaments() << " " <<
367  Linker::numLinkers() << " " <<
368  MotorGhost::numMotorGhosts() << " " <<
370  Bubble::numBubbles() << endl;;
371 
372  for(auto &filament : Filament::getFilaments()) {
373 
374  //print first line (Filament ID, type, length, left_delta, right_delta)
375  _outputFile << "FILAMENT " << filament->getID() << " " <<
376  filament->getType() << " " <<
377  filament->getCylinderVector().size() + 1 << " " <<
378  filament->getDeltaMinusEnd() << " " << filament->getDeltaPlusEnd() << endl;
379 
380  //print
381  for (auto cylinder : filament->getCylinderVector()){
382 
383  double k = cylinder->getMCylinder()->getStretchingConst();
384  double deltaL = cylinder->getMCylinder()->getLength() -
385  cylinder->getMCylinder()->getEqLength();
386 
387  _outputFile<< abs(k * deltaL) << " ";
388 
389  }
390  //print last
391  Cylinder* cylinder = filament->getCylinderVector().back();
392  double k = cylinder->getMCylinder()->getStretchingConst();
393  double deltaL = cylinder->getMCylinder()->getLength() -
394  cylinder->getMCylinder()->getEqLength();
395  _outputFile<< abs(k * deltaL);
396 
397  _outputFile << endl;
398  }
399 
400  for(auto &linker : Linker::getLinkers()) {
401 
402  //print first line
403  _outputFile << "LINKER " << linker->getID()<< " " <<
404  linker->getType() << endl;
405 
406  //print
407  double k = linker->getMLinker()->getStretchingConstant();
408  double deltaL = linker->getMLinker()->getLength() -
409  linker->getMLinker()->getEqLength();
410 
411 
412  _outputFile << abs(k * deltaL) << " " <<
413  abs(k * deltaL) << endl;
414  }
415 
416  for(auto &motor : MotorGhost::getMotorGhosts()) {
417 
418  //print first line
419  //also contains a Bound(1) or unbound(0) qualifier
420  _outputFile << "MOTOR " << motor->getID() << " " << motor->getType() << " " << 1 << endl;
421 
422  //print
423  double k = motor->getMMotorGhost()->getStretchingConstant();
424  double deltaL = motor->getMMotorGhost()->getLength() -
425  motor->getMMotorGhost()->getEqLength();
426 
427  _outputFile << abs(k * deltaL) << " " <<
428  abs(k * deltaL) << endl;
429  }
430 
431  //DEPRECATED AS OF 9/8/16
432 // //collect diffusing motors
433 // for(auto md: _subSystem->getCompartmentGrid()->getDiffusingMotors()) {
434 //
435 // int ID = get<0>(md);
436 // int type = get<1>(md);
437 //
438 // auto firstPoint = get<2>(md);
439 // auto secondPoint = get<3>(md);
440 //
441 // _outputFile << "MOTOR " << ID << " " << type << " " << 0 << endl;
442 //
443 // //print coordinates
444 // //print birth times
445 // _outputFile << 0 << " " << 0 << endl;
446 // }
447 
448  for(auto &branch : BranchingPoint::getBranchingPoints()) {
449 
450  //print first line
451  _outputFile << "BRANCHER " << branch->getID() << " " <<
452  branch->getType() << endl;
453 
454  //Nothing for branchers
455  _outputFile << 0.0 << endl;
456  }
457  for(auto &bubble : Bubble::getBubbles()) {
458 
459  //print first line
460  _outputFile << "BUBBLE " << bubble->getID() << " " <<
461  bubble->getType() << endl;
462 
463  //Nothing for bubbles
464  _outputFile << 0.0 << endl;
465  }
466 
467  _outputFile <<endl;
468 }
469 
470 
471 void WallTensions::print(int snapshot) {
472 
473  _outputFile.precision(10);
474 
475  // print first line (snapshot number, time, number of filaments,
476  // linkers, motors, branchers)
477  _outputFile << snapshot << " " << tau() << " " <<
478  Filament::numFilaments() << " " <<
479  Linker::numLinkers() << " " <<
480  MotorGhost::numMotorGhosts() << " " <<
482  Bubble::numBubbles() << endl;;
483 
484  for(auto &filament : Filament::getFilaments()) {
485 
486  //print first line (Filament ID, type, length, left_delta, right_delta)
487  _outputFile << "FILAMENT " << filament->getID() << " " <<
488  filament->getType() << " " <<
489  filament->getCylinderVector().size() + 1 << " " <<
490  filament->getDeltaMinusEnd() << " " << filament->getDeltaPlusEnd() << endl;
491 
492  //print
493  for (auto cylinder : filament->getCylinderVector()){
494 
495  double k = SysParams::Mechanics().pinK;
496  Bead* b = cylinder->getFirstBead();
497 
498  if(b->isPinned()) {
499  auto norm = _subSystem->getBoundary()->normal(b->pinnedPosition);
500  auto dirL = twoPointDirection(b->pinnedPosition, b->coordinate);
501 
502  double deltaL = twoPointDistance(b->coordinate, b->pinnedPosition);
503 
504 
505  _outputFile<< k * deltaL * dotProduct(norm, dirL) << " ";
506  }
507  else
508  _outputFile << 0.0 << " ";
509 
510  }
511  //print last
512  Cylinder* cylinder = filament->getCylinderVector().back();
513  double k = SysParams::Mechanics().pinK;
514  Bead* b = cylinder->getSecondBead();
515 
516  if(b->isPinned()) {
517  auto norm = _subSystem->getBoundary()->normal(b->pinnedPosition);
518  auto dirL = twoPointDirection(b->pinnedPosition, b->coordinate);
519 
520  double deltaL = twoPointDistance(b->coordinate, b->pinnedPosition);
521 
522  _outputFile<< k * deltaL * dotProduct(norm, dirL) << " ";
523  }
524  else
525  _outputFile << 0.0 << " ";
526 
527  _outputFile << endl;
528  }
529 
530  for(auto &linker : Linker::getLinkers()) {
531 
532  //print first line
533  _outputFile << "LINKER " << linker->getID()<< " " <<
534  linker->getType() << endl;
535 
536  _outputFile << 0.0 << " " << 0.0 << endl;
537  }
538 
539  for(auto &motor : MotorGhost::getMotorGhosts()) {
540 
541  //print first line
542  _outputFile << "MOTOR " << motor->getID() << " " <<
543  motor->getType() << endl;
544 
545  _outputFile << 0.0 << " " << 0.0 << endl;
546  }
547 
548  for(auto &branch : BranchingPoint::getBranchingPoints()) {
549 
550  //print first line
551  _outputFile << "BRANCHER " << branch->getID() << " " <<
552  branch->getType() << endl;
553 
554  //Nothing for branchers
555  _outputFile << 0.0 << endl;
556  }
557  for(auto &bubble : Bubble::getBubbles()) {
558 
559  //print first line
560  _outputFile << "BUBBLE " << bubble->getID() << " " <<
561  bubble->getType() << endl;
562 
563  //Nothing for bubbles
564  _outputFile << 0.0 << endl;
565  }
566 
567  _outputFile <<endl;
568 }
569 
570 
571 void Types::print(int snapshot) {
572 
573  _outputFile.precision(10);
574 
575  // print first line (snapshot number, time, number of filaments,
576  // linkers, motors, branchers)
577  _outputFile << snapshot << " " << tau() << " " <<
578  Filament::numFilaments() << " " <<
579  Linker::numLinkers() << " " <<
580  MotorGhost::numMotorGhosts() << " " <<
582  Bubble::numBubbles() << endl;;
583 
584  for(auto &filament : Filament::getFilaments()) {
585 
586  //print first line (Filament ID, type, length, left_delta, right_delta)
587  _outputFile << "FILAMENT " << filament->getID() << " " <<
588  filament->getType() << " " <<
589  filament->getCylinderVector().size() + 1 << " " <<
590  filament->getDeltaMinusEnd() << " " << filament->getDeltaPlusEnd() << endl;
591 
592  //print
593  for (auto cylinder : filament->getCylinderVector()){
594 
595  _outputFile<< cylinder->getType() << " ";
596 
597  }
598  //print last
599  Cylinder* cylinder = filament->getCylinderVector().back();
600  _outputFile<< cylinder->getType();
601 
602  _outputFile << endl;
603  }
604 
605  for(auto &linker : Linker::getLinkers()) {
606 
607  //print first line
608  _outputFile << "LINKER " << linker->getID()<< " " <<
609  linker->getType() << endl;
610 
611  _outputFile << linker->getType() << " " <<
612  linker->getType() << endl;
613  }
614 
615  for(auto &motor : MotorGhost::getMotorGhosts()) {
616 
617  //print first line
618  //also contains a Bound(1) or unbound(0) qualifier
619  _outputFile << "MOTOR " << motor->getID() << " " << motor->getType() << " " << 1 << endl;
620 
621  _outputFile << motor->getType() << " " <<
622  motor->getType() << endl;
623  }
624 
625  //DEPRECATED AS OF 9/8/16
626 // //collect diffusing motors
627 // for(auto md: _subSystem->getCompartmentGrid()->getDiffusingMotors()) {
628 //
629 // int ID = get<0>(md);
630 // int type = get<1>(md);
631 //
632 // auto firstPoint = get<2>(md);
633 // auto secondPoint = get<3>(md);
634 //
635 // _outputFile << "MOTOR " << ID << " " << type << " " << 0 << endl;
636 //
637 // //print coordinates
638 // //print birth times
639 // _outputFile << type << " " << type << endl;
640 // }
641 
642  for(auto &branch : BranchingPoint::getBranchingPoints()) {
643 
644  //print first line
645  _outputFile << "BRANCHER " << branch->getID() << " " <<
646  branch->getType() << endl;
647 
648  //Nothing for branchers
649  _outputFile << branch->getType() << endl;
650  }
651  for(auto &bubble : Bubble::getBubbles()) {
652 
653  //print first line
654  _outputFile << "BUBBLE " << bubble->getID() << " " <<
655  bubble->getType() << endl;
656 
657  //Nothing for bubbles
658  _outputFile << bubble->getType() << endl;
659  }
660 
661  _outputFile <<endl;
662 }
663 
664 
665 void Chemistry::print(int snapshot) {
666 
667  // print first line (snapshot number, time)
668  _outputFile << snapshot << " " << tau() << endl;
669 
670  // all diffusing and bulk species
671  for(auto sd : _chemData.speciesDiffusing) {
672 
673  string name = get<0>(sd);
674  auto copyNum = _grid->countDiffusingSpecies(name);
675 
676  _outputFile << name << ":DIFFUSING " << copyNum << endl;
677  }
678 
679  for(auto sb : _chemData.speciesBulk) {
680 
681  string name = get<0>(sb);
682  auto copyNum = _grid->countBulkSpecies(name);
683 
684  _outputFile << name << ":BULK " << copyNum << endl;
685  }
686 
687  for(int filType = 0; filType < SysParams::Chemistry().numFilaments; filType++) {
688 
689  for(auto sf : _chemData.speciesFilament[filType]) {
690 
691  auto copyNum = Filament::countSpecies(filType, sf);
692  _outputFile << sf << ":FILAMENT " << copyNum << endl;
693  }
694 
695  for(auto sp : _chemData.speciesPlusEnd[filType]) {
696 
697  auto copyNum = Filament::countSpecies(filType, sp);
698  _outputFile << sp << ":PLUSEND " << copyNum << endl;
699  }
700 
701  for(auto sm : _chemData.speciesMinusEnd[filType]) {
702 
703  auto copyNum = Filament::countSpecies(filType, sm);
704  _outputFile << sm << ":MINUSEND " << copyNum << endl;
705  }
706 
707  for(auto sl : _chemData.speciesLinker[filType]) {
708 
709  auto copyNum = Linker::countSpecies(sl);
710  _outputFile << sl << ":LINKER " << copyNum << endl;
711  }
712 
713  for(auto sm : _chemData.speciesMotor[filType]) {
714 
715  auto copyNum = MotorGhost::countSpecies(sm);
716  _outputFile << sm << ":MOTOR " << copyNum << endl;
717  }
718 
719  for(auto sb : _chemData.speciesBrancher[filType]) {
720 
721  auto copyNum = BranchingPoint::countSpecies(sb);
722  _outputFile << sb << ":BRANCHER " << copyNum << endl;
723  }
724  }
725 
726  _outputFile <<endl;
727 }
728 
729 void MotorLifetimes::print(int snapshot) {
730 
731  _outputFile.precision(3);
732 
733  // print first line (snapshot number, time)
734  _outputFile << snapshot << " " << tau() << " " << endl;
735 
736  MotorGhost::getLifetimes()->print(_outputFile);
737  _outputFile << endl << endl;
738 
739  //clear list
741 }
742 
743 void MotorWalkLengths::print(int snapshot) {
744 
745  _outputFile.precision(3);
746 
747  // print first line (snapshot number, time)
748  _outputFile << snapshot << " " << tau() << " " << endl;
749 
750  MotorGhost::getWalkLengths()->print(_outputFile);
751  _outputFile << endl << endl;
752 
753  //clear list
755 }
756 
757 
758 void LinkerLifetimes::print(int snapshot) {
759 
760  _outputFile.precision(3);
761 
762  // print first line (step number, time)
763  _outputFile << snapshot << " " << tau() << " " << endl;
764 
765  Linker::getLifetimes()->print(_outputFile);
766  _outputFile << endl << endl;
767 
768  //clear list
770 }
771 
772 
773 void FilamentTurnoverTimes::print(int snapshot) {
774 
775  _outputFile.precision(3);
776 
777  // print first line (step number, time)
778  _outputFile << snapshot << " " << tau() << " " << endl;
779 
780  Filament::getTurnoverTimes()->print(_outputFile);
781  _outputFile << endl << endl;
782 }
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:758
static const ChemParams & Chemistry()
Const getter.
Definition: SysParams.h:263
static Histogram * getLifetimes()
Get the lifetimes.
Definition: MotorGhost.h:171
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:259
static const vector< Linker * > & getLinkers()
Get all instances of this class from the SubSystem.
Definition: Linker.h:130
static const vector< BranchingPoint * > & getBranchingPoints()
Get all instances of this class from the SubSystem.
static Histogram * getLifetimes()
Get the lifetimes.
Definition: Linker.h:139
vector< double > twoPointDirection(const vector< double > &v1, const vector< double > &v2)
Calculates a normal to a line starting at (x1,y1,z1) and ending at (x2,y2,z2)
Definition: MathFunctions.h:77
virtual size_t countSpecies() const
Return the number of Species contained under this node&#39;s hieararchy.
Definition: Component.h:122
double getStretchingConst()
Mechanical parameter management function.
Definition: MCylinder.h:73
vector< double > pinnedPosition
The bead can be pinned to a certain position in the simulation volume.
Definition: Bead.h:78
double getLength()
Mechanical parameter management function.
Definition: MCylinder.h:85
A container to store a MCylinder and CCylinder.
Definition: Cylinder.h:50
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:729
is used for the mathematics module for the entire codebase mathfunc includes functions to calculate d...
double dotProduct(const vector< double > &v1, const vector< double > &v2)
Scalar product of two vectors v1(x,y,z) and v2(x,y,z)
Definition: MathFunctions.h:88
double pinK
Tethered stiffness.
Definition: SysParams.h:88
static int numFilaments()
Get the number of filaments in this system.
Definition: Filament.h:187
vector< double > coordinate
Coordinates of the bead.
Definition: Bead.h:54
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:471
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:773
virtual size_t countSpecies() const override
Returns the number of Species being managed by this node and its descendent nodes.
Definition: Composite.h:120
Bead * getSecondBead()
Get beads.
Definition: Cylinder.h:114
double twoPointDistance(const vector< double > &v1, const vector< double > &v2)
Compute distance between two points with coordinates: (x1,y1,z1) and (x2,y2,z3)
Definition: MathFunctions.h:54
void clearValues()
Clears all values from histogram.
Definition: Histogram.h:61
static const vector< MotorGhost * > & getMotorGhosts()
Get all instances of this class from the SubSystem.
Definition: MotorGhost.h:162
static const MechParams & Mechanics()
Const getter.
Definition: SysParams.h:262
double getEqLength()
Get the current equlibrium length of this MCylinder.
Definition: MCylinder.h:62
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:38
vector< double > midPointCoordinate(const vector< double > &v1, const vector< double > &v2, double alpha)
Returns coordinates of a point v located on a line between v1 and v2.
static int numBubbles()
Get the number of cylinders in this system.
Definition: Bubble.h:93
static int numLinkers()
Get the number of linkers in this system.
Definition: Linker.h:134
short numFilaments
Number of different filament types.
Definition: SysParams.h:117
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:665
static int numMotorGhosts()
Get the number of motors in this system.
Definition: MotorGhost.h:166
static const vector< Bubble * > & getBubbles()
Get all instances of this class from the SubSystem.
Definition: Bubble.h:89
static const vector< Filament * > & getFilaments()
Get all instances of this class from the SubSystem.
Definition: Filament.h:183
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:743
static Histogram * getWalkLengths()
Get walk lengths.
Definition: MotorGhost.h:174
virtual int getType()
Get cylinder type.
Definition: Cylinder.cpp:85
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:359
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:571
static int numBranchingPoints()
Get the number of branching points in this system.
bool isPinned()
Definition: Bead.h:132
virtual void print(int snapshot)
To be implemented in sub classes.
Definition: Output.cpp:164
Represents a single coordinate between Cylinders, and holds forces needed for mechanical equilibratio...
Definition: Bead.h:49
double tau()
Definition: common.h:30
void print(ofstream &outputFile)
Print the histogram.
Definition: Histogram.h:66
MCylinder * getMCylinder()
Get mech cylinder.
Definition: Cylinder.h:100
static Histogram * getTurnoverTimes()
Get the turnover times.
Definition: Filament.h:191