GraphNet: Discrete element modeling for network connected materials
Applications to polymeric networks
Functions
helper_funcs.cpp File Reference
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <math.h>
#include <random>
#include <time.h>
#include <vector>
#include <unistd.h>
#include <algorithm>
#include <ctime>
#include <chrono>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <stddef.h>
#include "vel.h"
#include "helper_funcs.h"
Include dependency graph for helper_funcs.cpp:

Functions

void mapping (int &edge_counter, int elem_type, int n_vertices, stringstream &input, int *edges)
 Converts mesh elements from GMSH file to edges and nodes. Only implemented elements of <element-id> = 2 or 3. Need to extend for 3D. More...
 
void mapping (int &edge_counter, int elem_type)
 Reads the number of edges in elements. Only implemented elements of <element-id> = 2 or 3. More...
 
string read_dump (int &n_nodes, int &n_elems, string &dname)
 Reads the number of nodes and poly chains left at the end of previous simulation. The code does not take care of parameters. Assumes user will change params.h file while restarting the previous simulation. More...
 
void read_n (int &n_nodes, int &n_elems, string &fname)
 Reads the number of nodes and edges according to the .msh file. Useful for allocating memory in the class' constructors. More...
 
void take_input (float *R, int *edges, int n_nodes, int n_elems, string &fname)
 Reads the input and converts to appropriate network data. More...
 
void __init__ (float *L, float *damage, bool *PBC, int n_elems)
 Initializes various properties for each edge in the graph. More...
 
void forcevector (float *result, float *r1, float *r2, float L)
 Gives a force vector given the nodes and the contour length of the polymer connecting these. More...
 
float getabsmax (float *arr, size_t sizeofarr)
 Gets the absolute maximum of an array. More...
 
void __init__ (float *L, int *m, float *damage, float *sacdamage, bool *PBC, int n_elems)
 Overrides init for sacNetworks. More...
 
int filename (const string &fname)
 Gives an integer value to be appended to the network dump filename. More...
 

Function Documentation

void __init__ ( float *  L,
float *  damage,
bool *  PBC,
int  n_elems 
)

Initializes various properties for each edge in the graph.

void __init__ ( float *  L,
int *  m,
float *  damage,
float *  sacdamage,
bool *  PBC,
int  n_elems 
)

Overrides init for sacNetworks.

int filename ( const string &  fname)

Gives an integer value to be appended to the network dump filename.

void forcevector ( float *  result,
float *  r1,
float *  r2,
float  L 
)

Gives a force vector given the nodes and the contour length of the polymer connecting these.

float getabsmax ( float *  arr,
size_t  sizeofarr 
)

Gets the absolute maximum of an array.

void mapping ( int &  edge_counter,
int  elem_type,
int  n_vertices,
stringstream &  input,
int *  edges 
)

Converts mesh elements from GMSH file to edges and nodes. Only implemented elements of <element-id> = 2 or 3. Need to extend for 3D.

void mapping ( int &  edge_counter,
int  elem_type 
)

Reads the number of edges in elements. Only implemented elements of <element-id> = 2 or 3.

string read_dump ( int &  n_nodes,
int &  n_elems,
string &  dname 
)

Reads the number of nodes and poly chains left at the end of previous simulation. The code does not take care of parameters. Assumes user will change params.h file while restarting the previous simulation.

void read_n ( int &  n_nodes,
int &  n_elems,
string &  fname 
)

Reads the number of nodes and edges according to the .msh file. Useful for allocating memory in the class' constructors.

void take_input ( float *  R,
int *  edges,
int  n_nodes,
int  n_elems,
string &  fname 
)

Reads the input and converts to appropriate network data.