<commit_before>//node.cpp
//=========================
#include <iostream>
#include <vector>
#include <cmath>
//=========================
#include "phys.h"
#include "coord.h"
#include "node.h"
#include "cell.h"
//=========================

//========================================
/** class Node Functions **/
Node::Node(Coord loc) {
	my_loc = loc;
	new_force = Coord();
}

Coord Node::get_Location() {
    return my_loc;
}

void Node::update_Location() {
    my_loc += new_force * dt;
    return;
}

//========================================
/** class Cyt Node Functions **/
Cyt_Node::Cyt_Node(Coord loc) : Node(loc) {};

void Cyt_Node::calc_Forces(Cell* my_cell) {
	//for cyt, just need morse potential for int-int and int-membr
	vector<Cyt_Node*> cyts;
	my_cell->get_CytNodes(cyts);

	Coord Fii = calc_Morse_II(cyts);

	Coord Fmi = calc_Morse_MI(my_cell->get_WallNodes());
	
    new_force = Fmi + Fii;

	return;
}

// Needs to have access:
//		-all the other cyt nodes of cell
//		-all the membr nodes of cell
Coord Cyt_Node::calc_Morse_II(vector<Cyt_Node*>& cyt_nodes) {
	//calc force for II
	Coord Fii; //need to initialize to zero

	for (unsigned int j = 0; j < cyt_nodes.size(); j++) {
		//don't calculate yourself
		if (cyt_nodes.at(j) != this) {
			//calc morse between this node and node j
			Fii += morse_Equation(cyt_nodes.at(j));
		}
	}

	return Fii;
}

Coord Cyt_Node::calc_Morse_MI(Wall_Node* orig) {
	//calc force for IM
	Coord Fmi;
	Wall_Node* curr = orig;
	
	do {
		Fmi = morse_Equation(curr);
		//update curr_wall
		curr = curr->get_Left_Neighbor();

	} while (curr != orig); 

	return Fmi;
}

Coord Cyt_Node::morse_Equation(Cyt_Node* cyt) {
	//use Int-Int variables
    Coord Fii;
    Coord diff_vect = cyt->get_Location() - my_loc;
    double diff_len = diff_vect.length();<commit_msg>FIXED morse_MI interactions<commit_after>//node.cpp
//=========================
#include <iostream>
#include <vector>
#include <cmath>
//=========================
#include "phys.h"
#include "coord.h"
#include "node.h"
#include "cell.h"
//=========================

//========================================
/** class Node Functions **/
Node::Node(Coord loc) {
	my_loc = loc;
	new_force = Coord();
}

Coord Node::get_Location() {
    return my_loc;
}

void Node::update_Location() {
    my_loc += new_force * dt;
    return;
}

//========================================
/** class Cyt Node Functions **/
Cyt_Node::Cyt_Node(Coord loc) : Node(loc) {};

void Cyt_Node::calc_Forces(Cell* my_cell) {
	//for cyt, just need morse potential for int-int and int-membr
	vector<Cyt_Node*> cyts;
	my_cell->get_CytNodes(cyts);

	Coord Fii = calc_Morse_II(cyts);

	Coord Fmi = calc_Morse_MI(my_cell->get_WallNodes());
	
    new_force = Fmi + Fii;

	return;
}

// Needs to have access:
//		-all the other cyt nodes of cell
//		-all the membr nodes of cell
Coord Cyt_Node::calc_Morse_II(vector<Cyt_Node*>& cyt_nodes) {
	//calc force for II
	Coord Fii; //need to initialize to zero

	for (unsigned int j = 0; j < cyt_nodes.size(); j++) {
		//don't calculate yourself
		if (cyt_nodes.at(j) != this) {
			//calc morse between this node and node j
			Fii += morse_Equation(cyt_nodes.at(j));
		}
	}

	return Fii;
}

Coord Cyt_Node::calc_Morse_MI(Wall_Node* orig) {
	//calc force for IM
	Coord Fmi;
	Wall_Node* curr = orig;
	
	do {
		Fmi += morse_Equation(curr);
		//update curr_wall
		curr = curr->get_Left_Neighbor();

	} while (curr != orig); 

	return Fmi;
}

Coord Cyt_Node::morse_Equation(Cyt_Node* cyt) {
	//use Int-Int variables
    Coord Fii;
    Coord diff_vect = cyt->get_Location() - my_loc;
    double diff_len = diff_vect.length();
{'fraction_non_alphanumeric': 0.22060038556871386, 'fraction_numerical': 0.000550812448361333, 'mean_word_length': 4.0374479889043, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6897198', 'n_tokens_mistral': 1393, 'n_tokens_neox': 1298, 'n_words': 327}