<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.dayel.com/comet/cometwiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.dayel.com/comet/cometwiki/index.php?action=history&amp;feed=atom&amp;title=Implementation_in_C%2B%2B</id>
		<title>Implementation in C++ - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.dayel.com/comet/cometwiki/index.php?action=history&amp;feed=atom&amp;title=Implementation_in_C%2B%2B"/>
		<link rel="alternate" type="text/html" href="http://www.dayel.com/comet/cometwiki/index.php?title=Implementation_in_C%2B%2B&amp;action=history"/>
		<updated>2026-04-29T05:08:59Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.22.3</generator>

	<entry>
		<id>http://www.dayel.com/comet/cometwiki/index.php?title=Implementation_in_C%2B%2B&amp;diff=311&amp;oldid=prev</id>
		<title>Markdayel at 01:02, 22 November 2009</title>
		<link rel="alternate" type="text/html" href="http://www.dayel.com/comet/cometwiki/index.php?title=Implementation_in_C%2B%2B&amp;diff=311&amp;oldid=prev"/>
				<updated>2009-11-22T01:02:31Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 01:02, 22 November 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can browse the source code here [http://&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;www.dayel&lt;/del&gt;.com/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;git&lt;/del&gt;/comet&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.git &lt;/del&gt;here].&amp;#160; The code is written in C++ for speed. We attempt to use an somewhat object-based approach, but a good many of the member variables are declared as static global to allow their access across threads.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can browse the source code here [http://&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;github&lt;/ins&gt;.com/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;markdayel&lt;/ins&gt;/comet here].&amp;#160; The code is written in C++ for speed. We attempt to use an somewhat object-based approach, but a good many of the member variables are declared as static global to allow their access across threads.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is a breakdown of the main classes and functions in the program. There are numerous other functions but this is the core of the program:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is a breakdown of the main classes and functions in the program. There are numerous other functions but this is the core of the program:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key cometwikidb:diff:version:1.11a:oldid:223:newid:311 --&gt;
&lt;/table&gt;</summary>
		<author><name>Markdayel</name></author>	</entry>

	<entry>
		<id>http://www.dayel.com/comet/cometwiki/index.php?title=Implementation_in_C%2B%2B&amp;diff=223&amp;oldid=prev</id>
		<title>Markdayel at 17:13, 28 April 2009</title>
		<link rel="alternate" type="text/html" href="http://www.dayel.com/comet/cometwiki/index.php?title=Implementation_in_C%2B%2B&amp;diff=223&amp;oldid=prev"/>
				<updated>2009-04-28T17:13:26Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:13, 28 April 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=Implementation in C++=&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;You can browse the source code here [http://www.dayel.com/git/comet.git here].&amp;#160; &lt;/ins&gt;The code is written in C++ for speed. We attempt to use an somewhat object-based approach, but a good many of the member variables are declared as static global to allow their access across threads.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The code is written in C++ for speed. We attempt to use an somewhat object-based approach, but a good many of the member variables are declared as static global to allow their access across threads.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is a breakdown of the main classes and functions in the program. There are numerous other functions but this is the core of the program:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here is a breakdown of the main classes and functions in the program. There are numerous other functions but this is the core of the program:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key cometwikidb:diff:version:1.11a:oldid:185:newid:223 --&gt;
&lt;/table&gt;</summary>
		<author><name>Markdayel</name></author>	</entry>

	<entry>
		<id>http://www.dayel.com/comet/cometwiki/index.php?title=Implementation_in_C%2B%2B&amp;diff=185&amp;oldid=prev</id>
		<title>Markdayel: Created page with '=Implementation in C++=  The code is written in C++ for speed. We attempt to use an somewhat object-based approach, but a good many of the member variables are declared as static...'</title>
		<link rel="alternate" type="text/html" href="http://www.dayel.com/comet/cometwiki/index.php?title=Implementation_in_C%2B%2B&amp;diff=185&amp;oldid=prev"/>
				<updated>2009-04-27T00:39:20Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;=Implementation in C++=  The code is written in C++ for speed. We attempt to use an somewhat object-based approach, but a good many of the member variables are declared as static...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Implementation in C++=&lt;br /&gt;
&lt;br /&gt;
The code is written in C++ for speed. We attempt to use an somewhat object-based approach, but a good many of the member variables are declared as static global to allow their access across threads.&lt;br /&gt;
&lt;br /&gt;
Here is a breakdown of the main classes and functions in the program. There are numerous other functions but this is the core of the program:&lt;br /&gt;
&lt;br /&gt;
* Main()&lt;br /&gt;
** Spawns threads: &amp;lt;code&amp;gt;collisiondetectionthread&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;linkforcesthread&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;applyforcesthread&amp;lt;/code&amp;gt; depending on the &amp;lt;code&amp;gt;USETHREAD_COLLISION&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;USETHREAD_LINKFORCES&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;USETHREAD_APPLYFORCES&amp;lt;/code&amp;gt; parameters.&lt;br /&gt;
** Parses the &amp;lt;code&amp;gt;comet_params.ini&amp;lt;/code&amp;gt; file to read parameters. All of the parameters are implemented as globals (should fix at some point)&lt;br /&gt;
** Creates the main &amp;lt;code&amp;gt;theactin&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nuc_object&amp;lt;/code&amp;gt; objects.&lt;br /&gt;
** Runs through the main iteration loop, calling &amp;lt;code&amp;gt;theactin.iterate()&amp;lt;/code&amp;gt; and saving snapshots every so often.&lt;br /&gt;
* Actin class&lt;br /&gt;
** There is only one actin object, &amp;lt;code&amp;gt;theactin&amp;lt;/code&amp;gt; , which constitutes the network, i.e.~contains the nodes and the functions that deal with them.&lt;br /&gt;
** The &amp;lt;code&amp;gt;iterate()&amp;lt;/code&amp;gt; function does one iteration pass, calling: &lt;br /&gt;
***&amp;lt;code&amp;gt;nucleator_node_interactions()&amp;lt;/code&amp;gt; displaces any nodes out of the nucleator object along a normal to the nucleator surface&lt;br /&gt;
***&amp;lt;code&amp;gt;nucleate()&amp;lt;/code&amp;gt; adds new harbinger nodes to the surface of the nucleator&lt;br /&gt;
***&amp;lt;code&amp;gt;crosslinknewnodes()&amp;lt;/code&amp;gt; crosslinks harbingers once they are ready&lt;br /&gt;
***&amp;lt;code&amp;gt;sortnodesbygridpoint()&amp;lt;/code&amp;gt; orders nodes by gridpoint. The {\it only} reason for this is for the division of labor when using threads: We do repulsion by gridpoint to save re-calculating nearby nodes if there are multiple nodes on one gridpoint, and we do not want to divide nodes on one gridpoint across multiple threads.&lt;br /&gt;
***&amp;lt;code&amp;gt;collisiondetection()&amp;lt;/code&amp;gt; detects whether nodes are within &amp;lt;code&amp;gt;NODE_REPULSIVE_RANGE&amp;lt;/code&amp;gt; of one another and adds the repulsive force to &amp;lt;code&amp;gt;rep_force_vec[]&amp;lt;/code&amp;gt; .&lt;br /&gt;
***&amp;lt;code&amp;gt;linkforces()&amp;lt;/code&amp;gt; Calculates the forces between nodes due to links and puts into &amp;lt;code&amp;gt;link_force_vec[]&amp;lt;/code&amp;gt; . If a link goes above a certain threshold force, marks it as broken and removes next time (again to prevent thread problems---since a link is removed both ways and we can't guarantee that both nodes are being processed by same thread)&lt;br /&gt;
***&amp;lt;code&amp;gt;applyforces()&amp;lt;/code&amp;gt; updates the positions of all the nodes. Sums over the threads for &amp;lt;code&amp;gt;rep_force_vec[]&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;link_force_vec[]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;repulsion_displacement_vec[]&amp;lt;/code&amp;gt; .  &lt;br /&gt;
***Numerous other functions for things like saving bmps, vrml etc. &lt;br /&gt;
**Nucleator class&lt;br /&gt;
*** There is only one nucleator object at the moment, &amp;lt;code&amp;gt;nuc_object&amp;lt;/code&amp;gt; , which is closely linked to the actin object&lt;br /&gt;
*** The nucleator is either a sphere, a capsule (i.e.~a sphere with a cylindrical segment stuck in the middle) or ellipsoid &lt;br /&gt;
*** &amp;lt;code&amp;gt;addnodes()&amp;lt;/code&amp;gt; adds harbingers to the surface of the nucleator. The probablility of addition of nodes is normalized by surface area and is symmetric if &amp;lt;code&amp;gt;ASYMMETRIC_NUCLEATION&amp;lt;/code&amp;gt; is zero, or asymmetric if 1 or 2 (stepped or linear bias)&lt;br /&gt;
*** &amp;lt;code&amp;gt;definenucleatorgrid()&amp;lt;/code&amp;gt; sets a list of gridpoints to check in case of nodes entering the nucleator. Called once at the beginning.&lt;br /&gt;
*** &amp;lt;code&amp;gt;iswithinnucleator()&amp;lt;/code&amp;gt; returns true if the node is within the nucleator&lt;br /&gt;
*** &amp;lt;code&amp;gt;collision()&amp;lt;/code&amp;gt; moves a node out of the nucleator along a normal vector &lt;br /&gt;
** Nodes class&lt;br /&gt;
*** Nodes exist only as members of the actin object&lt;br /&gt;
*** &amp;lt;code&amp;gt;nodegrid&amp;lt;/code&amp;gt; is a 3 dimensional C++ vector of node pointers. Each nodegrid entry starts a circularly linked list of nodes representing the nodes within that gridpoint voxel.&lt;br /&gt;
*** The actin class contains a vector of nodes. Each node has an associated &amp;lt;code&amp;gt;nodenum&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; position, &amp;lt;code&amp;gt;nextnode&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;prevnode&amp;lt;/code&amp;gt; node pointers for the nodegrid linked list, &amp;lt;code&amp;gt;rep_force_vec[]&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;link_force_vec[]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;repulsion_displacement_vec[]&amp;lt;/code&amp;gt; as described above, the grid position of the node, &amp;lt;code&amp;gt;harbinger&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;polymer&amp;lt;/code&amp;gt; flags and a &amp;lt;code&amp;gt;listoflinks&amp;lt;/code&amp;gt; i.e. a vector of link object which attach this node to other nodes.&lt;br /&gt;
*** &amp;lt;code&amp;gt;polymerize()&amp;lt;/code&amp;gt; Creates a node as a harbinger. Adds its pointer to the gridpoint linked list.&lt;br /&gt;
*** &amp;lt;code&amp;gt;depolymerize()&amp;lt;/code&amp;gt; Removes a node, deletes all links and removes from grid.&lt;br /&gt;
*** &amp;lt;code&amp;gt;setgridcoords()&amp;lt;/code&amp;gt; Calculates new grid co-ordinates based on x,y,z position&lt;br /&gt;
*** &amp;lt;code&amp;gt;addtogrid()&amp;lt;/code&amp;gt; adds the node to the current gridpoint&lt;br /&gt;
*** &amp;lt;code&amp;gt;removefromgrid()&amp;lt;/code&amp;gt; removes node from the grid&lt;br /&gt;
*** &amp;lt;code&amp;gt;updategrid()&amp;lt;/code&amp;gt; checks to see if node has moved gridpoints, and updates grid is needs to&lt;br /&gt;
*** &amp;lt;code&amp;gt;removelink()&amp;lt;/code&amp;gt; removes the specified node from the list of links&lt;br /&gt;
** Links class&lt;br /&gt;
*** Links exist only as members of the node objects&lt;br /&gt;
*** Each link has an associated &amp;lt;code&amp;gt;linkednodeptr&amp;lt;/code&amp;gt; which points to the target node that the link is to and a &amp;lt;code&amp;gt;broken&amp;lt;/code&amp;gt; flag which is read by &amp;lt;code&amp;gt;actin::linkforces()&amp;lt;/code&amp;gt; and tells it to delete the link if it broke.&lt;br /&gt;
*** &amp;lt;code&amp;gt;orig_dist&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;orig_distsqr&amp;lt;/code&amp;gt; store the original distance of the link&lt;br /&gt;
*** &amp;lt;code&amp;gt;breakcount&amp;lt;/code&amp;gt; stores the number of consecutive iterations the link force has been above &amp;lt;code&amp;gt;LINK_BREAKAGE_FORCE&amp;lt;/code&amp;gt; and is used to increase the probability of breakage&lt;br /&gt;
*** &amp;lt;code&amp;gt;getlinkforces()&amp;lt;/code&amp;gt; returns the force acting on the link. Also sets the &amp;lt;code&amp;gt;broken&amp;lt;/code&amp;gt; flag and increments &amp;lt;code&amp;gt;breakcount&amp;lt;/code&amp;gt; if appropriate&lt;/div&gt;</summary>
		<author><name>Markdayel</name></author>	</entry>

	</feed>