The set-up of the problem to be solved for this example is identical to the one in Tutorial: Non-Linear Kirchhoff-Love shell analysis. The reader is referred to that example for a full overview of the code.
The assembly of the linear stiffness matrix and the external force vector are similar as in Tutorial: Non-Linear Kirchhoff-Love shell analysis. To assemble the mass matrix, an additional assembly is performed using assembleMass()
. The full assembly is given by:
In addition, an operator for mass and damping needs to be defined. These operators are simple lambda functions returning a constant matrix:
Using the mass, damping and Jacobian matrices \(M\), \(C\) and \(K_{NL}(\mathbf{u})\) and a residual vector \(R(\mathbf{u})\), an non-linear dynamic solver can be defined. In the following, a gsDynamicNewmark is defined:
The non-linear dynamic problem is solved by stepping over time. After some initializations, a simple time stepping loop is used:
#ifdef gsKLShell_ENABLED
#include <gsKLShell/gsKLShell.h>
#endif
int main(int argc, char *argv[])
{
#ifdef gsKLShell_ENABLED
bool plot = false;
cmd.addInt( "e", "degreeElevation","Number of degree elevation steps to perform before solving (0: equalize degree in all directions)", numElevate );
cmd.addInt( "r", "uniformRefine", "Number of Uniform h-refinement steps to perform before solving", numRefine );
cmd.addSwitch("plot", "Create a ParaView visualization file with the solution", plot);
try { cmd.getValues(argc,argv); } catch (int rv) { return rv; }
if (numElevate!=0)
for (int r =0; r < numRefine; ++r)
point<< 0.5, 0.5 ; load << 0, 0.0, -1e4 ;
pLoads.addLoad(point, load, 0 );
std::vector<gsFunctionSet<>*> parameters{&E,&nu};
options.
addInt(
"Material",
"Material model: (0): SvK | (1): NH | (2): NH_ext | (3): MR | (4): Ogden",1);
options.
addInt(
"Implementation",
"Implementation: (0): Composites | (1): Analytical | (2): Generalized | (3): Spectral",1);
assembler.setPointLoads(pLoads);
assembler.assemble();
assembler.assembleMass();
{
assembler.constructSolution(x,def);
m = assembler.matrix();
};
{
assembler.constructSolution(x,def);
v = assembler.rhs();
};
gsInfo<<
"Solving system with "<<assembler.numDofs()<<
" DoFs\n";
solver.options().setSwitch("Verbose",true);
size_t N = assembler.numDofs();
U.setZero();
V.setZero();
A.setZero();
solver.setU(U);
solver.setV(V);
solver.setA(A);
real_t time = 0;
real_t dt = 1e-2;
solver.setTimeStep(dt);
{
gsInfo<<
"Load step "<< k<<
"\n";
U = solver.solutionU();
displ = assembler.constructDisplacement(U);
def = assembler.constructSolution(U);
if (plot)
{
std::string outputName = "Deformation" + std::to_string(k) + "_";
gsWriteParaview<>( solField, outputName, 1000, true);
collection.addPart(outputName + "0.vts",time);
}
time = solver.time();
}
if (plot)
collection.save();
return EXIT_SUCCESS;
#else
GISMO_ERROR(
"The tutorial needs to be compiled with gsKLShell enabled");
return EXIT_FAILED;
#endif
}
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
void addCornerValue(boxCorner c, T value, int p=0, short_t unknown=0, int component=-1)
Adds a boundary condition with value on a corner c of patch p for unknown component.
Definition gsBoundaryConditions.h:726
void setGeoMap(const gsFunctionSet< T > &gm)
Set the geometry map to evaluate boundary conditions.
Definition gsBoundaryConditions.h:916
Class for command-line argument parsing.
Definition gsCmdLine.h:57
Class defining a globally constant function.
Definition gsConstantFunction.h:34
Performs the arc length method to solve a nonlinear system of equations.
Definition gsDynamicNewmark.h:35
A scalar of vector field defined on a m_parametric geometry.
Definition gsField.h:55
Class defining a multivariate (real or vector) function given by a string mathematical expression.
Definition gsFunctionExpr.h:52
memory::unique_ptr< gsMaterialMatrixBase > uPtr
Unique pointer for gsGeometry.
Definition gsMaterialMatrixBase.h:44
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
void degreeElevate(short_t const elevationSteps=1, short_t const dir=-1)
Elevate the degree of all patches by elevationSteps, preserves smoothness.
Definition gsMultiPatch.hpp:282
bool computeTopology(T tol=1e-4, bool cornersOnly=false, bool tjunctions=false)
Attempt to compute interfaces and boundaries automatically.
Definition gsMultiPatch.hpp:377
void uniformRefine(int numKnots=1, int mul=1, short_t const dir=-1)
Refine uniformly all patches by inserting numKnots in each knot-span with multipliplicity mul.
Definition gsMultiPatch.hpp:271
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
void addInt(const std::string &label, const std::string &desc, const index_t &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:201
This class is used to create a Paraview .pvd (collection) file.
Definition gsParaviewCollection.h:77
Class containing a set of points on a multi-patch isogeometric domain, together with boundary conditi...
Definition gsPointLoads.h:65
Reads an object from a data file, if such the requested object exists in the file.
Definition gsReadFile.h:43
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
Assembles the system matrix and vectors for 2D and 3D shell problems, including geometric nonlinearit...
Definition gsThinShellAssembler.h:77
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
Main header to be included by clients using the G+Smo library.
#define GISMO_ERROR(message)
Definition gsDebug.h:118
Class to perform time integration of second-order structural dynamics systems using the Explicit Eule...
Class providing Structural Analysis Utilities.
The G+Smo namespace, containing all definitions for the library.
ThinShellAssemblerStatus
Definition gsThinShellAssembler.h:54
@ Success
Assembly is successful.
std::function< bool(gsVector< T > const &, gsSparseMatrix< T > &) > Jacobian_t
Jacobian.
Definition gsStructuralAnalysisTypes.h:86
std::function< bool(gsVector< T > const &, gsVector< T > &)> Residual_t
Residual, Fint-Fext.
Definition gsStructuralAnalysisTypes.h:68