331 lines
32 KiB
HTML
331 lines
32 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.10"/>
|
|
<title>3D Beam Finite Element Code: Main Page</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { init_search(); });
|
|
</script>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js"],
|
|
jax: ["input/TeX","output/HTML-CSS"],
|
|
});
|
|
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="logo_64x64.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">3D Beam Finite Element Code
|
|
 <span id="projectnumber">1.0</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.10 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">3D Beam Finite Element Code Documentation</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><h2>Getting started</h2>
|
|
<p>This project requires CMake to compile the code. If not installed, install CMake before continuing. If you intend on building the GUI, Qt must be installed and the path to the Qt5WidgetsConfig.cmake file must be set when invoking CMake. Currently, the following method of building the GUI works on Mac and Linux. If running on Windows, open the fea_gui.pro file with QtCreator (included with the Qt installation) and run. Alternatively, I can package pre-built binaries if there is interest. <br />
|
|
</p><h4>To compile the code:</h4>
|
|
<ol type="1">
|
|
<li>Open the <code>threed-beam-fea</code> directory</li>
|
|
<li>Create a folder named <code>build</code></li>
|
|
<li>Open a terminal and navigate to the newly formed <code>build</code> directory</li>
|
|
<li>Execute <code>cmake ..</code><ul>
|
|
<li>Use <code>-DCMAKE_BUILD_TYPE=debug</code> if you would like to build the code for debugging purposes. By default the make files will be configured for the release build.</li>
|
|
<li>If you wish to build the GUI execute <code>cmake .. -DFEA_BUILD_GUI=ON -DCMAKE_PREFIX_PATH="/path/to/Qt"</code><ul>
|
|
<li>This requires you have Qt >= 5.0 installed.</li>
|
|
<li><code>-DFEA_BUILD_GUI=ON</code> tells cmake to add the <code>../gui</code> subdirectory and adds <code>fea_gui</code> to the targets.</li>
|
|
<li><code>-DCMAKE_PREFIX_PATH="/path/to/Qt"</code> should be the path to the Qt root directory. <br />
|
|
As an example, on my computer the flag is set to "/home/ryan/Qt/5.5/gcc_64/", though this will be different on your machine.</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>On Linux run <code>make</code> in the terminal from the build directory to build all the targets. On Windows the solution file will be located in the build directory. Open the solution file in Visual Studio and compile.</li>
|
|
</ol>
|
|
<h2>Introduction</h2>
|
|
<p>This contains a C++ implementation of 3D Euler-Bernoulli beam element formulation. An analysis can be formulated in C++, through a command line interface via a config file, or using the graphical user interface.</p>
|
|
<h3>Method 1: Using C++</h3>
|
|
<p>An analysis consists of the <code><a class="el" href="structfea_1_1_job.html" title="Contains a node list, element list, and the properties of each element. ">fea::Job</a></code> as well as any boundary conditions (<code><a class="el" href="structfea_1_1_b_c.html" title="A boundary condition to enforce. ">fea::BC</a></code>), prescribed nodal forces (<code><a class="el" href="structfea_1_1_force.html" title="A nodal force to enforce. ">fea::Force</a></code>), and ties (<code><a class="el" href="structfea_1_1_tie.html" title="Places linear springs between all degrees of freedom of 2 nodes. ">fea::Tie</a></code>). The latter of which ties to nodes together via a linear springs between all translational and rotational degrees of freedom. The <code><a class="el" href="structfea_1_1_options.html" title="Provides a method for customizing the finite element analysis. ">fea::Options</a></code> struct can be used to request results of the analysis be written to disk as well as modify various aspect of the analysis.</p>
|
|
<h4>Forming the job</h4>
|
|
<p>The job defines the nodal coordinates in \((x, y, z)\) space, the nodes that are connected to form beam elements, and the elemental properties. The nodal coordinates are formed as a vector of <code><a class="el" href="namespacefea.html#acea7372904bb1c5f0570e9a53cf6fba9" title="A node that describes a mesh. Uses Eigen's predefined Vector class for added functionality. ">fea::Node</a></code>'s where each node simply contains the \((x, y, z)\) coordinates of the point. An element contains the 2 nodal indices that are connected to form the element as well as the associated properties of the element. The properties must define the extensional stiffness, \(EA\), bending stiffness parallel to the local z-axis \(EI_{z}\), bending stiffness parallel to the local y-axis \(EI_{y}\), the torsional stiffness, \(GJ\), and a vector pointing along the beam elements local y-axis. An example forming a simple job with a single element is shown below.</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// [form the node list</span></div>
|
|
<div class="line"><a class="code" href="namespacefea.html#acea7372904bb1c5f0570e9a53cf6fba9">fea::Node</a> node1, node2;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// place the first node at (0, 0, 0)</span></div>
|
|
<div class="line">node1 << 0, 0, 0;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// place the second node at (1, 0, 0)</span></div>
|
|
<div class="line">node2 << 1, 0, 0;</div>
|
|
<div class="line"></div>
|
|
<div class="line">std::vector<fea::Node> node_list = {node1, node2};</div>
|
|
<div class="line"><span class="comment">// ]</span></div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// [ form the element list</span></div>
|
|
<div class="line"><span class="comment">// define the indices of the node list that form the element</span></div>
|
|
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nn1 = 0;</div>
|
|
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nn2 = 1;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// define the properties of the element</span></div>
|
|
<div class="line"><span class="keywordtype">double</span> EA = 1000.0;</div>
|
|
<div class="line"><span class="keywordtype">double</span> EIz = 100.0;</div>
|
|
<div class="line"><span class="keywordtype">double</span> EIy = 100.0;</div>
|
|
<div class="line"><span class="keywordtype">double</span> GJ = 200.0;</div>
|
|
<div class="line">std::vector<double> normal_vec = {0.0, 0.0, 1.0};</div>
|
|
<div class="line"><a class="code" href="structfea_1_1_props.html">fea::Props</a> props(EA, EIz, EIy, GJ, normal_vec);</div>
|
|
<div class="line"></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_elem.html">fea::Elem</a> elem(nn1, nn2, props);</div>
|
|
<div class="line"></div>
|
|
<div class="line">std::vector<fea::Elem> elem_list = {elem};</div>
|
|
<div class="line"><span class="comment">// ]</span></div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// a job is the combination of the node list and associated elements</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_job.html">fea::Job</a> job(node_list, elem_list);</div>
|
|
</div><!-- fragment --><h4>Boundary conditions</h4>
|
|
<p>Boundary conditions are applied by specifying the index of the node, the degree of freedom, and the prescribed value. The index of the node is simply the index the node occurs in the node list. The degree of freedom can be defined using the <code><a class="el" href="namespacefea.html#aeaca75d33e81b79c9282f3e69a238d72" title="Convenience enumerator for specifying the active degree of freedom in a constraint. ">fea::DOF</a></code> enum or by specifying the integer associated with the degree of freedom explicitly. There are 6 degrees of freedom per node meaning valid integers associated with degrees of freedom are between 0 and 5. The associations for degrees of freedom are defined as</p>
|
|
<ul>
|
|
<li>0 = displacement along the global x-axis.</li>
|
|
<li>1 = displacement along the global y-axis.</li>
|
|
<li>2 = displacement along the global z-axis.</li>
|
|
<li>3 = rotation about the global x-axis.</li>
|
|
<li>4 = rotation about the global y-axis.</li>
|
|
<li>5 = rotation about the global z-axis.</li>
|
|
</ul>
|
|
<p>Continuing the example from above, we can fix all degrees of freedom of the node at the origin using the following code:</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// fix all translational degrees of freedom using the fea::DOF enum</span></div>
|
|
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nn1 = 0;</div>
|
|
<div class="line"><span class="keywordtype">double</span> value = 0.0;</div>
|
|
<div class="line"><a class="code" href="structfea_1_1_b_c.html">fea::BC</a> bc1(nn1, <a class="code" href="namespacefea.html#aeaca75d33e81b79c9282f3e69a238d72a0bfcf6fc693c952c376a1d9eb9cf03fb">fea::DOF::DISPLACEMENT_X</a>, value);</div>
|
|
<div class="line"><a class="code" href="structfea_1_1_b_c.html">fea::BC</a> bc2(nn1, <a class="code" href="namespacefea.html#aeaca75d33e81b79c9282f3e69a238d72ad39e7a11a71cac64252cb1fb1d94c7f9">fea::DOF::DISPLACEMENT_Y</a>, value);</div>
|
|
<div class="line"><a class="code" href="structfea_1_1_b_c.html">fea::BC</a> bc3(nn1, <a class="code" href="namespacefea.html#aeaca75d33e81b79c9282f3e69a238d72a83e84bbf75a8e85c73e0fd2bb935bcf1">fea::DOF::DISPLACEMENT_Z</a>, value);</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// fix all rotational degrees of freedom by explicitly using integer values</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_b_c.html">fea::BC</a> bc4(nn1, 3, value); <span class="comment">// x-axis rotation</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_b_c.html">fea::BC</a> bc5(nn1, 4, value); <span class="comment">// y-axis rotation</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_b_c.html">fea::BC</a> bc6(nn1, 5, value); <span class="comment">// z-axis rotation</span></div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// form the list of boundary conditions</span></div>
|
|
<div class="line"><span class="comment">// this vector will later be submitted to the</span></div>
|
|
<div class="line"><span class="comment">// fea::solve function to run an analysis</span></div>
|
|
<div class="line">std::vector<fea::BC> bc_list = {bc1, bc2, bc3, bc4, bc5, bc6};</div>
|
|
</div><!-- fragment --><h4>Nodal forces</h4>
|
|
<p>Nodal forces are assigned in the same manner as boundary conditions, i.e. using the node number, degree of freedom, and value. We can load our cantilever at the tip with the following:</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// define the node index and value</span></div>
|
|
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nn2 = 1;</div>
|
|
<div class="line"><span class="keywordtype">double</span> value = 1.0;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// create the force</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_force.html">fea::Force</a> force(nn2, <a class="code" href="namespacefea.html#aeaca75d33e81b79c9282f3e69a238d72ad39e7a11a71cac64252cb1fb1d94c7f9">fea::DOF::DISPLACEMENT_Y</a>, value);</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// add to the list of forces for the analysis</span></div>
|
|
<div class="line">std::vector<fea::Force> force_list</div>
|
|
</div><!-- fragment --><h4>Options</h4>
|
|
<p>By default submitting an analysis to the <code><a class="el" href="namespacefea.html#aca9724c7cab58b0671b29f3f4318e599" title="Solves the finite element analysis defined by the input Job, boundary conditions, and prescribed noda...">fea::solve</a></code> function will not save the results. The outputs must be requested using the <code><a class="el" href="structfea_1_1_options.html" title="Provides a method for customizing the finite element analysis. ">fea::Options</a></code> struct. Using the appropriate member variables nodal displacements, nodal forces, and the forces associated with ties can be saved to a CSV file. The name of the file the output is saved to is also set in the options as well as the delimiter used when writing the data to disk. Additionally, the <code><a class="el" href="structfea_1_1_options.html" title="Provides a method for customizing the finite element analysis. ">fea::Options</a></code> struct has the ability to set the epsilon value on nodal forces and displacements. After the analysis if the magnitude of the displacement is below the epsilon value, it will be set to 0.0. The default is <code>1.0e-14</code>. A summary of the analysis can be saved to a text file using the <code>save_report</code> and <code>report_filename</code> member variables of <code><a class="el" href="structfea_1_1_options.html" title="Provides a method for customizing the finite element analysis. ">fea::Options</a></code>. If the <code>verbose</code> member is set to <code>true</code> informational messages regarding the current step and time taken on previous steps of the analysis will be written to <code>std::cout</code>. An example of customizing the analysis with the options struct is shown below:</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// create the default options</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_options.html">fea::Options</a> opts;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// request nodal forces and displacements</span></div>
|
|
<div class="line">opts.<a class="code" href="structfea_1_1_options.html#a7ef9cc3bf01c181a3cf34fc4451cd4e9">save_nodal_forces</a> = <span class="keyword">true</span>;</div>
|
|
<div class="line">opts.<a class="code" href="structfea_1_1_options.html#a1d053be484e4c5a79d0eab2447883823">save_nodal_displacements</a> = <span class="keyword">true</span>;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// set custom name for nodal forces output</span></div>
|
|
<div class="line">opts.<a class="code" href="structfea_1_1_options.html#ad6b7ccda4984e4160c6cdbcefa496a26">nodal_forces_filename</a> = <span class="stringliteral">"cantilever_beam_forces.csv"</span></div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// increase tolerance on epsilon</span></div>
|
|
<div class="line">opts.<a class="code" href="structfea_1_1_options.html#ad52313d1d4af202ae7bf382c2a6bf50e">epsilon</a> = 1.0e-12;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// have the program output status updates</span></div>
|
|
<div class="line">opts.<a class="code" href="structfea_1_1_options.html#a7fc006a76a6edea968fb6e5b63e0b56d">verbose</a> = <span class="keyword">true</span>;</div>
|
|
</div><!-- fragment --><h4>Solving</h4>
|
|
<p>Once the analysis has been setup, it can be solved using the <code><a class="el" href="namespacefea.html#aca9724c7cab58b0671b29f3f4318e599" title="Solves the finite element analysis defined by the input Job, boundary conditions, and prescribed noda...">fea::solve</a></code> function. This functions takes as input the job, boundary conditions, prescribed nodal forces, ties (discussed below), and options. <code><a class="el" href="namespacefea.html#aca9724c7cab58b0671b29f3f4318e599" title="Solves the finite element analysis defined by the input Job, boundary conditions, and prescribed noda...">fea::solve</a></code> will solve the analysis, save the requested files, and return a summary of the analysis. The <code><a class="el" href="structfea_1_1_summary.html" title="Contains the results of an analysis after calling fea::solve. ">fea::Summary</a></code> object can return a report of the analysis in the form of a string using the <code>fea::Summary::fullReport()</code> function, and member variables <code><a class="el" href="structfea_1_1_summary.html#a9858284f86514f1d7922bc7c458da385">fea::Summary::nodal_forces</a></code>, <code><a class="el" href="structfea_1_1_summary.html#ad05822565a41e374c77f84c6c3b358b2">fea::Summary::nodal_displacements</a></code>, and <code><a class="el" href="structfea_1_1_summary.html#af1822f670a2d6bfbf76f042a0cb544ff">fea::Summary::tie_forces</a></code> contain the results of the analysis.</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// form an empty vector of ties since none were prescribed</span></div>
|
|
<div class="line">std::vector<fea::Tie> tie_list;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_summary.html">fea::Summary</a> summary = <a class="code" href="namespacefea.html#aca9724c7cab58b0671b29f3f4318e599">fea::solve</a>(job, node_list, elem_list, bc_list, force_list, tie_list, opts);</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// print a report of the analysis</span></div>
|
|
<div class="line">std::cout << summary.fullReport() << std::endl;</div>
|
|
</div><!-- fragment --><h4>Ties</h4>
|
|
<p>Ties are enforced by placing linear springs between all degrees of freedom for 2 nodes. To form a tie specify the 2 nodes that will be linked as well as the spring constants for translational and rotational degrees of freedom. All translational degrees of freedom will be assigned the same spring constant. The same is true for rotational degrees of freedom, although the spring constant does not have to be the same as that used for the translational DOFs. Commonly, ties are used to model non-rigid joints. To form a joint between 2 elements, introduce a redundant node at that location and use a tie to link the to nodes together. This essentially places a spring element between the two points of the specified stiffness.</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// form the job with a redundant node at (1, 0, 0)</span></div>
|
|
<div class="line"></div>
|
|
<div class="line"><a class="code" href="namespacefea.html#acea7372904bb1c5f0570e9a53cf6fba9">fea::Node</a> node1, node2, node3, node4;</div>
|
|
<div class="line">node1 << 0, 0, 0;</div>
|
|
<div class="line">node2 << 1, 0, 0;</div>
|
|
<div class="line">node3 << 1, 0, 0;</div>
|
|
<div class="line">node4 << 2, 0, 0;</div>
|
|
<div class="line">std::vector<fea::Node> node_list = {node1, node2, node3, node4};</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// define the properties of the elements</span></div>
|
|
<div class="line"><span class="keywordtype">double</span> EA = 1000.0;</div>
|
|
<div class="line"><span class="keywordtype">double</span> EIz = 100.0;</div>
|
|
<div class="line"><span class="keywordtype">double</span> EIy = 100.0;</div>
|
|
<div class="line"><span class="keywordtype">double</span> GJ = 200.0;</div>
|
|
<div class="line">std::vector<double> normal_vec = {0.0, 0.0, 1.0};</div>
|
|
<div class="line"><a class="code" href="structfea_1_1_props.html">fea::Props</a> props(EA, EIz, EIy, GJ, normal_vec);</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// constuct element list</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_elem.html">fea::Elem</a> elem1(0, 1, props);</div>
|
|
<div class="line"><a class="code" href="structfea_1_1_elem.html">fea::Elem</a> elem2(2, 3, props);</div>
|
|
<div class="line">std::vector<fea::Elem> elem_list = {elem};</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// create the job</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_job.html">fea::Job</a> job(node_list, elem_list);</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// create the tie between node2 and node3</span></div>
|
|
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nn1 = 1; <span class="comment">// i.e. the second node in the node list</span></div>
|
|
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nn2 = 2; <span class="comment">// i.e. the third node in the node list</span></div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// define the spring constant for x, y, and z translational DOFs</span></div>
|
|
<div class="line"><span class="keywordtype">double</span> lmult = 100.0;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// define the spring constant for x, y, and z rotational DOFs</span></div>
|
|
<div class="line"><span class="keywordtype">double</span> rmult = 100.0;</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// form the tie</span></div>
|
|
<div class="line"><a class="code" href="structfea_1_1_tie.html">fea::Tie</a> tie1(nn1, nn2, lmult, rmult);</div>
|
|
<div class="line"></div>
|
|
<div class="line"><span class="comment">// add to list of ties</span></div>
|
|
<div class="line">std::vector<fea::Tie> tie_list = {tie1};</div>
|
|
</div><!-- fragment --><h3>Method 2: Using the command line interface</h3>
|
|
<p>After using CMake to build the targets, an executable will be created that provide a command line interface (CLI) to the beam element code. Once in the build directory, navigate to the <code>bin</code> folder containing fea_cmd. running <code>./fea_cmd -h</code> from the terminal will show the help documentation for the program. The CLI expects the <code>-c</code> flag to be set and point to the config file for the current analysis. A config file is a JSON document that contains key, value pairs pointing to the nodes, elements, properties, and other analysis options. An example is shown below.</p>
|
|
<div class="fragment"><div class="line">{</div>
|
|
<div class="line"> <span class="stringliteral">"nodes"</span> : <span class="stringliteral">"path/to/nodes.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"elems"</span> : <span class="stringliteral">"path/to/elems.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"props"</span> : <span class="stringliteral">"path/to/props.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"bcs"</span> : <span class="stringliteral">"path/to/bcs.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"forces"</span> : <span class="stringliteral">"path/to/forces.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"ties"</span> : <span class="stringliteral">"path/to/ties.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"options"</span> : {</div>
|
|
<div class="line"> <span class="stringliteral">"epsilon"</span> : 1.0E-14,</div>
|
|
<div class="line"> <span class="stringliteral">"csv_delimiter"</span> : <span class="stringliteral">","</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"csv_precision"</span> : 8,</div>
|
|
<div class="line"> <span class="stringliteral">"save_nodal_forces"</span> : <span class="keyword">true</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"save_nodal_displacements"</span> : <span class="keyword">true</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"save_tie_forces"</span> : <span class="keyword">true</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"save_report"</span> : <span class="keyword">true</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"nodal_forces_filename"</span> : <span class="stringliteral">"nodal_forces.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"nodal_displacements_filename"</span> : <span class="stringliteral">"nodal_displacements.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"tie_forces_filename"</span> : <span class="stringliteral">"tie_forces.csv"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"report_filename"</span> : <span class="stringliteral">"report.txt"</span>,</div>
|
|
<div class="line"> <span class="stringliteral">"verbose"</span> : <span class="keyword">true</span></div>
|
|
<div class="line"> }</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><p>The use of a JSON document avoids the need to set each of these options using command line options, which can become tedious when running multiple jobs. The "nodes", "elems", and "props" keys are required. Keys "bcs", "forces", and "ties" are optional–if not provided the analysis will assume none were prescribed. If the "options" key is not provided the analysis will run with the default options. Any of all of the "options" keys presented above can be used to customize the analysis. If a key is not provided the default value is used in its place. See the Formatting CSV Files section below for how the CSV files should be created.</p>
|
|
<h3>Method 3: Using the GUI</h3>
|
|
<p>A simple graphical user interface can be used to set up an analysis. Internally, the GUI creates the JSON file used by the CLI (see above) without the need to write the file by hand. The program then saves a temporary configuration file and submits it to the command line application. This requires that the command line application has been compiled and is located in the same directory as the GUI. To open the GUI navigate to the build folder and open the fea_gui executable located in the <code>bin</code> directory. The first set of buttons allows the path to the CSV files to be set, and the second set of controls customizes the options. Once the files and options have been configured, clicking the submit button will run the analysis.</p>
|
|
<h2>Formatting CSV files</h2>
|
|
<p>All CSV file must be comma delimited with no spaces between values, i.e. one row of the nodal coordinates file might resemble <code>1.0,2.0,3.0</code>. The file indicated by the value of "nodes" should be in the format:</p>
|
|
<div class="fragment"><div class="line">x1,y1,z1</div>
|
|
<div class="line">x2,y2,z2</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">xN,yN,zN</div>
|
|
</div><!-- fragment --><p>where each entry is a double and every line must have 3 entries for the <code>x,y,z</code> position. The "elems" file contains (only) the node indices:</p>
|
|
<div class="fragment"><div class="line">el1_node_num_1,el1_node_num_2</div>
|
|
<div class="line">el2_node_num_1,el2_node_num_2</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">elN_node_num_1,elN_node_num_2</div>
|
|
</div><!-- fragment --><p>where each entry is an integer and must have 2 nodal indices defining the connectivity of the element. Elemental properties are defined in the "props" file as:</p>
|
|
<div class="fragment"><div class="line">el1_EA,el1_EIz,el1_EIy,el1_GJ,el1_nvec_x_comp,el1_nvec_y_comp,el1_nvec_z_comp</div>
|
|
<div class="line">el2_EA,el2_EIz,el2_EIy,el2_GJ,el2_nvec_x_comp,el2_nvec_y_comp,el2_nvec_z_comp</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">elN_EA,elN_EIz,elN_EIy,elN_GJ,elN_nvec_x_comp,elN_nvec_y_comp,elN_nvec_z_comp</div>
|
|
</div><!-- fragment --><p>where each entry is a double and each line has 7 entries. The "bcs" and "forces" CSV files have the same format. Each line specifies the node number, degree of freedom, and value:</p>
|
|
<div class="fragment"><div class="line">bc1_node_num,bc1_dof,bc1_value</div>
|
|
<div class="line">bc2_node_num,bc2_dof,bc2_value</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">bcN_node_num,bcN_dof,bcN_value</div>
|
|
</div><!-- fragment --><p>where the node number is the index of the node in the node list (integer), the DOF is the degree of freedom constrained (integer between 0 and 5), and value is the value to hold the degree of freedom at relative to the starting position (double). The "ties" CSV file is specified using the format:</p>
|
|
<div class="fragment"><div class="line">tie1_node_num1,tie1_node_num2,tie1_lmult,tie1_rmult</div>
|
|
<div class="line">tie1_node_num1,tie1_node_num2,tie1_lmult,tie1_rmult</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">...</div>
|
|
<div class="line">tieN_node_num1,tieN_node_num2,tieN_lmult,tieN_rmult</div>
|
|
</div><!-- fragment --><p>where <code>lmult</code> is the spring constant for the translational degrees of freedom and <code>rmult</code> is the spring constant for the rotational degrees of freedom.</p>
|
|
<h2>Contact</h2>
|
|
<ul>
|
|
<li>Ryan Latture (<a href="#" onclick="location.href='mai'+'lto:'+'rya'+'n.'+'lat'+'tu'+'re@'+'gm'+'ail'+'.c'+'om'; return false;">ryan.<span style="display: none;">.nosp@m.</span>latt<span style="display: none;">.nosp@m.</span>ure@g<span style="display: none;">.nosp@m.</span>mail<span style="display: none;">.nosp@m.</span>.com</a>) </li>
|
|
</ul>
|
|
</div></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Mon Nov 9 2015 11:57:00 for 3D Beam Finite Element Code by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.10
|
|
</small></address>
|
|
</body>
|
|
</html>
|