#ifdef gsElasticity_ENABLED
#endif
#ifdef gsElasticity_ENABLED
int main(int argc, char *argv[])
{
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; }
std::string fileName = "paraboloid_volume.xml";
if (numElevate!=0)
for (int r =0; r < numRefine; ++r)
{
}
{
}
assembler.options().setReal("YoungsModulus",1.E9);
assembler.options().setReal("PoissonsRatio",0.45);
assembler.options().setInt("DirichletValues",dirichlet::l2Projection);
assemblerMass.options() = assembler.options();
assemblerMass.options().addReal("Density","Density of the material",1.E8);
assembler.assemble();
assemblerMass.assemble();
std::vector<gsMatrix<> > fixedDofs = assembler.allFixedDofs();
{
assembler.assemble(x,fixedDofs);
m = assembler.matrix();
return true;
};
{
assembler.assemble(x,fixedDofs);
v = assembler.rhs();
return true;
};
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();
assembler.constructSolution(U,assembler.allFixedDofs(),displ);
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 gsElasticity enabled");
return EXIT_FAILED;
#endif
}
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
void addCondition(int p, boxSide s, condition_type::type t, gsFunctionSet< T > *f, short_t unknown=0, bool parametric=false, int comp=-1)
Adds another boundary condition.
Definition gsBoundaryConditions.h:650
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
Performs the arc length method to solve a nonlinear system of equations.
Definition gsDynamicNewmark.h:35
Assembles the stiffness matrix and the right-hand side vector for linear and nonlinear elasticity for...
Definition gsElasticityAssembler.h:32
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
Assembles the mass matrix and right-hand side vector for linear and nonlinear elasticity for 2D plain...
Definition gsMassAssembler.h:31
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
gsGeometry< T > & patch(size_t i) const
Return the i-th patch.
Definition gsMultiPatch.h:292
index_t nPieces() const
Number of pieces in the domain of definition.
Definition gsMultiPatch.h:193
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
This class is used to create a Paraview .pvd (collection) file.
Definition gsParaviewCollection.h:77
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
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 index_t
Definition gsConfig.h:32
#define GISMO_ERROR(message)
Definition gsDebug.h:118
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
#define gsInfo
Definition gsDebug.h:43
Class to perform time integration of second-order structural dynamics systems using the Explicit Eule...
Provides linear and nonlinear elasticity systems for 2D plain strain and 3D continua.
Provides isogeometric meshing and modelling routines.
Provides mass matrix for elasticity systems in 2D plain strain and 3D continua.
Class providing Structural Analysis Utilities.
The G+Smo namespace, containing all definitions for the library.
gsStatus
Definition gsStructuralAnalysisTypes.h:21
@ neumann
Neumann type.
Definition gsBoundaryConditions.h:33
std::function< bool(gsVector< T > const &, gsSparseMatrix< T > &) > Jacobian_t
Jacobian.
Definition gsStructuralAnalysisTypes.h:86
std::function< bool(gsSparseMatrix< T > &) > Mass_t
Mass matrix.
Definition gsStructuralAnalysisTypes.h:75
std::function< bool(gsVector< T > const &, gsSparseMatrix< T > &) > Damping_t
Damping matrix.
Definition gsStructuralAnalysisTypes.h:79
std::function< bool(gsVector< T > const &, gsVector< T > &)> Residual_t
Residual, Fint-Fext.
Definition gsStructuralAnalysisTypes.h:68
@ saint_venant_kirchhoff
sigma = 2*mu*eps + lambda*tr(eps)*I
Definition gsBaseUtils.h:132