Solvers
Module with solution method for the elastic problem.
This module provides functions for solving elastic problems using the finite element method.
Functions:
| Name | Description |
|---|---|
solve_elastic_problem |
Solves an elastic problem using the finite element method. |
compute_external_work |
Computes the external work due to imposed forces and body forces. |
compute_external_work(domain, v, bcs)
Computes the external work due to imposed forces and body forces.
This function calculates the external work on a boundary of the given mesh by integrating the dot product of imposed traction forces and a test function over the relevant boundary entities. It also accounts for body forces applied within the domain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
Domain
|
The finite element mesh representing the domain. |
required |
v
|
Function
|
The test function representing the virtual displacement or velocity. |
required |
bcs
|
BoundaryConditions
|
Object containing the boundary conditions, including body forces and force boundary conditions. |
required |
Returns:
| Type | Description |
|---|---|
Form
|
ufl.classes.Form: A UFL form representing the external work, which can be integrated over the domain or used in variational formulations. |
Source code in src/gcrack/solvers.py
solve_elastic_problem(domain, model, bcs)
Solves an elastic problem using the finite element method.
This function sets up and solves a linear elastic problem using the finite element method. It defines the function space, boundary conditions, and variational formulation based on the elastic energy and external work. The problem is solved using PETSc's LinearProblem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
Domain
|
The domain object representing the physical space. |
required |
model
|
ElasticModel
|
The elastic model defining the material properties. |
required |
bcs
|
BoundaryConditions
|
The boundary conditions for the problem. |
required |
Returns:
| Type | Description |
|---|---|
Function
|
fem.Function: The displacement solution of the elastic problem. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the 2D assumption is unknown. |