A program which calculated the stress field for given functions and grid. The input files for the plot properties and the physical constants are provided through the MATLAB program bin_write.m
and the program bin_read.m
can be sued to plot the results calculated by stress_field_calculator.cpp
.
At the moment the programs does not sync automatically and must be manually run in both MATLAB and the preferred C++ editor. Also, the function for the stresses are coded in the C++ file and changing these, or appending new functions, requires changes in the main code.
The program now includes the analytic element for gravity, and it produces the Cartesian stress field ( , & ), the principal stress field ( , & ) and the principal stress trajectories. Also, it computes the displacement filed and the displacement trajectories. For a given resolution and coordinates.
A log file, log.txt
, is created with all the variable data and time stamp.
This program has been developed using Microsoft Visual Stuido and only the .cpp
file is included in the repository.
To generate plot for stresses filed (here only for gravity at the moment) follow the following procedure:
- Run
bin_write.m
- Generates the input data and plot data in
input_data.bin
andplot_data.bin
.
- Generates the input data and plot data in
- Run
sw_calculator_code.cpp
- Calculates the stress fields and provide them in
data.bin
and the dimensions indim_data.bin
.
- Calculates the stress fields and provide them in
- Run
bin_read.m
- Reads the data and plots the stress fields.
The program inludes several analytic element for linear elasticity. Currently the following anlaytic elements are included:
- gravity,
- cracks (not yet released) and
- circular tunnel (not yet released).
This list contains all the definitions of the user input data defined in bin_wirte.m
. These are the model properties:
H
the elevation for where the gravity is set to zerorho
the density of the elastic mediumg
the Newtonian constant of gravitationnu
the Poisson's ratiokappa
the bulk modulus (is calculated by default withkappa = 3-4*nu
)sigma_11inf
the uniform stress statenc
inclued with cracksm
inclued with cracksz1
inclued with cracksz2
inclued with cracksL
inclued with cracksmu
inclued with cracksbeta
inclued with cracksnt
inclued with circular tunnelmt
inclued with circular tunnelz0
inclued with circular tunnelR
inclued with circular tunnela
inclued with circular tunnelb
inclued with circular tunnel
These are the plotting properties:
xfrom
the starting value for x-axisxto
the end value for the x-axisyfrom
the starting value for the y-axisyto
the end value for the y-axisNx
the number of grid points in the x-diractionNy
the number of grid points in the y-directionNtraj
the number of steps for the stress trajectorieslvs_traj
the number of stress trajectoriesxtraj
the vector containing the start and end point for the line hwere the trajectores are evenly spaced, forytraj
the vector containing the start and end point for the line hwere the trajectores are evenly spaced, forNw
the number of grid points in the x- and y-direction for the displacements
Created by,
Erik Toller