MAST
|
This example computes the nonlinaer deformation of a curved plate with a temperature and pressure load using path continuation solver.
For direct solver, run with options: -ksp_type preonly -pc_type lu
Initialize libMesh library.
wapper to GetPot used to read in values for parameters
Create Mesh object on default MPI communicator and generate a 2D mesh of QUAD4 elements. We discretize with 12 elements in the x-direction (0.0 to 36.0 inches) and 40 elements in the y-direction (0.0 to 120.0 inches). Note that in libMesh, all meshes are parallel by default in the sense that the equations on the mesh are solved in parallel by PETSc. A "ReplicatedMesh" is one where all MPI processes have the full mesh in memory, as compared to a "DistributedMesh" where the mesh is "chunked" up and distributed across processes, each having their own piece.
get the node for which the displacement will be written to the load.txt file.
if a finite radius is defined, change the mesh to a circular arc of specified radius
initialize the pointer to a node
compute angle based on y-location
also, create a boundary id for this node since we will constrain the x-displacement here
For later reference, the boundary and subdomain ID's generated by the libMesh mesh generation are sketched below.
* y (#) Boundary ID * | (2) [#] Subdomain ID * 120.0 O-----O * | | x - right * | | y - up * (3) | [0] | (1) z - out of screen * | | * | | * 0.0 O-----O--x * (0) * 0.0 36.0 *
Create EquationSystems object, which is a container for multiple systems of equations that are defined on a given mesh.
Add system of type MAST::NonlinearSystem (which wraps libMesh::NonlinearImplicitSystem) to the EquationSystems container. We name the system "structural" and also get a reference to the system so we can easily reference it later.
Create a finite element type for the system. Here we use first order Lagrangian-type finite elements.
Initialize the system to the correct set of variables for a structural analysis. In libMesh this is analogous to adding variables (each with specific finite element type/order to the system for a particular system of equations.
Initialize a new structural discipline using equation_systems.
Create and add boundary conditions to the structural system. A Dirichlet BC adds fixed displacement BCs. Here we use the side boundary ID numbering created by the libMesh generator to clamp the edge of the mesh along x=0.0. We apply the simply supported BC on bottom and top. For clamped edges, set vars={0, 1, 2, 3, 4, 5, 6}.
this applies the simply supported condition to the bottom (bid=0) and top (bid=1) edges. For setting conditions to left (bid=3) and right (bid=1) call the method with the respective boundary ids.
discipline.add_dirichlet_bc(3, clamped_edge3); // Attach boundary condition to discipline
Initialize the equation system since we now know the size of our system matrices (based on mesh, element type, variables in the structural_system) as well as the setup of dirichlet boundary conditions. This initialization process is basically a pre-processing step to preallocate storage and spread it across processors.
Create parameters.
Create ConstantFieldFunctions used to spread parameters throughout the model.
Initialize point load.
Create the material property card ("card" is NASTRAN lingo) and the relevant parameters to it. An isotropic material needs elastic modulus (E) and Poisson ratio (nu) to describe its behavior.
Create the section property card. Attach all property values.
Attach material to the card.
Initialize the specify the subdomain in the mesh that it applies to.
Create nonlinear assembly object and set the discipline and structural_system. Create reference to system.
Zero the solution before solving.
Write output to Exodus.
Solve the system and print displacement degrees-of-freedom to screen.
write the header to the load.txt file
first solve the the temperature increments
specify temperature as the load parameter to be changed per load step
the initial deformation direction is identified with a unit change in temperature.
with the search direction defined, we define the arc length per load step to be a factor of 2 greater than the initial step.
get the value of the node at the center of the plate for output
write the value to the load.txt file
write the current solution to the exodus file for visualization
next, solve the the pressure increments
specify pressure as the load parameter to be changed per load step
initial search direction is defined usign a pressure of 2e3.
the arch length is chanegd to a factor of 4 for each load step.