tadd bonding - slidergrid - grid of elastic sliders on a frictional surface
 (HTM) git clone git://src.adamsgaard.dk/slidergrid
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 75872d905c2b8343e79dfd89b2122ad4d51b4f63
 (DIR) parent 6c55b2b5c3ebfea7827b1513dd5db5ac6cafd94b
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Tue, 15 Mar 2016 15:14:56 -0700
       
       add bonding
       
       Diffstat:
         M grid.c                              |      17 +----------------
         M grid.h                              |       5 +++++
         M main.c                              |       2 ++
       
       3 files changed, 8 insertions(+), 16 deletions(-)
       ---
 (DIR) diff --git a/grid.c b/grid.c
       t@@ -34,7 +34,7 @@ slider* create_regular_slider_grid(
        }
        
        /* Find neighboring sliders within a defined cutoff distance */
       -void find_neighbors_n2(
       +void find_and_bond_to_neighbors_n2(
                slider* sliders,
                const int N,
                const Float cutoff)
       t@@ -58,21 +58,6 @@ void find_neighbors_n2(
                    }
                }
            }
       -
       -
       -}
       -
       -// From the list of neighbors, find which sliders are within the debonding 
       -// distance
       -void bond_to_neighbors(
       -        const slider* sliders,
       -        const int N,
       -        const Float debonding_distance)
       -{
       -
       -                // bond slider to the two closest neighbors in each direction
       -                //sliders[i].neighbors = malloc(sizeof(int)*
       -
        }
        
        int save_slider_positions_to_file(
 (DIR) diff --git a/grid.h b/grid.h
       t@@ -10,6 +10,11 @@ slider* create_regular_slider_grid(
                const Float dy,
                const Float dz);
        
       +void find_and_bond_to_neighbors_n2(
       +        slider* sliders,
       +        const int N,
       +        const Float cutoff);
       +
        int save_slider_positions_to_file(
                const slider* sliders,
                const int N,
 (DIR) diff --git a/main.c b/main.c
       t@@ -18,6 +18,8 @@ int main(int argc, char** argv)
            for (i=0; i<N; i++)
                sliders[i].mass = 1.;
        
       +    find_and_bond_to_neighbors_n2(sliders, N, 1.5);
       +
            // temporal loop
            Float t;
            const Float t_end = 1.;