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
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
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. |
Source code in src/gcrack/solvers.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |