Problem Class
Class
- class problem.Compliance_Problem[source]
This is the Compliance problem class.
- Parameters:
name (str) – The Compliance shape optimization problem’s name.
- constraint(u, lame_mu, lame_lambda, parameters, measure, xsi=0, vm_DG=0, c_k=0)[source]
Compute the value of constraint.
- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The integrand of the norm Lp of the Von Mises criteria.
- Return type:
ufl.Expression
- constraint_integrand(u, lame_mu, lame_lambda, parameters)[source]
Compute the integrand of the area constraint.
- Returns:
The integrand of the constraint function.
- Return type:
ufl.Expression
- cost(u=0, p=0, lame_mu=0, lame_lambda=0, measure=0, Parameters=0)[source]
Compute the cost function, defined as :
\[J\left( \Omega \right) = \int_{\Omega} 0.5 \times \left( 2\mu \sigma(u_{h}):\sigma(u_{h}) + \lambda \nabla \cdot \sigma(u_{h}):\nabla \cdot \sigma(u_{h}) \right) \text{ }dx\]- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
- Returns:
The integrand of the cost function.
- Return type:
ufl.Expression
- cost_integrand(u, lame_mu, lame_lambda, Parameters=0)[source]
Compute the integrand of the cost function, defined as :
\[j\left( u \right) = 0.5 \times \left( 2\mu \sigma(u):\sigma(u) + \lambda \nabla \cdot \sigma(u):\nabla \cdot \sigma(u) \right)\]- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
- Returns:
The integrand of the cost function.
- Return type:
ufl.Expression
- dual_operator(u, lame_mu, lame_lambda, parameters, mesh, measure=0, vm_DG=0, c_k=0)[source]
Compute the dual operator.
- Parameters:
u (fem.Function) – The solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
mesh (Mesh) – The mesh of the domaine \(D\).
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
- Return type:
float.
- shape_derivative_integrand(u, p, lame_mu, lame_lambda, parameters, measure=0)[source]
Compute the following shape derivative integrand:
\[\begin{split}\begin{align} x =& j\left( u_{h} \right) - 2\mu \sigma(u_{h}):\sigma(p_{h}) + \lambda \nabla \cdot \sigma(u_{h}):\nabla \cdot \sigma(p_{h}) \\ = & - 0.5 \times \left( 2\mu \sigma(u_{h}):\sigma(p_{h}) + \lambda \nabla \cdot \sigma(u_{h}):\nabla \cdot \sigma(p_{h}) \right) \end{align}\end{split}\]Remark:
For the special case of the compliance minimization, we have \(\\u_{h} = \\p_{h}\)
- param fem.Function u:
The solution of the primal problem \(\\u_{h}\).
- returns:
The shape derivative of the cost function minus linear elasticity.
- rtype:
ufl.Expression
- class problem.VMLp_Problem[source]
This is the Von Mises Lp norm problem class.
- Parameters:
name (str) – The Von Mises Lp norm shape optimization problem’s name.
- constraint(u, lame_mu, lame_lambda, parameters, measure, xsi=0, vm_DG=0, c_k=0)[source]
Compute the value of constraint.
- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The integrand of the norm Lp of the Von Mises criteria.
- Return type:
ufl.Expression
- constraint_integrand(u, lame_mu, lame_lambda, parameters)[source]
Compute the integrand of the area constraint.
- Returns:
The integrand of the constraint function.
- Return type:
ufl.Expression
- cost(u=0, p=0, lame_mu=0, lame_lambda=0, measure=0, Parameters=0)[source]
Compute the cost function, defined as :
\[\begin{split}J\left( \Omega \right) = & \left[ \int_{\Omega} \left[\frac{\sigma_{VM}\left(u_{h}\right)}{\overline{\sigma_{VM}}}\right]^{p}\text{ }dx \right]^{\frac{1}{p}} \\\end{split}\]with \(\sigma_{VM}\left(u_{h}\right)\) compute with the function
mecanics_tool.von_mises()and \(\overline{\sigma_{VM}}\) a constant attribut of Parameters.- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The integrand of the cost function.
- Return type:
ufl.Expression
- cost_integrand(u, lame_mu, lame_lambda, Parameters)[source]
Compute the integrand of the cost function given by the following formula:
\[x = \left[\frac{\sigma_{VM}\left(u_{h}\right)}{\overline{\sigma_{VM}}}\right]^{p}\]with \(\sigma_{VM}\left(u_{h}\right)\) compute with the function
mecanics_tool.von_mises()and \(\overline{\sigma_{VM}}\) a constant attribut of Parameters.- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
- Returns:
The integrand of the norm Lp of the Von Mises criteria.
- Return type:
ufl.Expression
- dual_operator(u, lame_mu, lame_lambda, parameters, mesh, measure=0, vm_DG=0, c_k=0)[source]
Compute the dual operator.
- Parameters:
u (fem.Function) – The solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
mesh (Mesh) – The mesh of the domaine \(D\).
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The dual linear form.
- Return type:
ufl.Expression
- shape_derivative_integrand(u, p, lame_mu, lame_lambda, parameters, measure=0)[source]
Compute the following shape derivative integrand:
\[\begin{split}\begin{align} x = & \frac{1}{p} \left[ \int_{\Omega} \left[\frac{\sigma_{VM}\left(u_{h}\right)}{\overline{\sigma_{VM}}}\right]^{p} \text{ }dx \right]^{\frac{1}{p}-1} \\ & \left[ \left( \frac{\sigma_{VM}\left(u_{h}\right)}{\overline{\sigma_{VM}}}\right)^{p}- 2\mu \sigma(u_{h}):\sigma(p_{h}) + \lambda \nabla \cdot \sigma(p_{h}):\nabla \cdot \sigma(u_{h}) \right] \end{align}\end{split}\]- Parameters:
u (fem.Function) – The solution of the primal problem \(\\u_{h}\).
p (fem.Function) – The solution of the dual problem \(\\p_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The shape derivative of the cost function minus linear elasticity.
- Return type:
ufl.Expression
- class problem.AreaProblem[source]
This is the Area problem class.
- Parameters:
name (str) – The Area shape optimization problem’s name.
- constraint(u, lame_mu, lame_lambda, parameters, measure, xsi=0, vm_DG=0, c_k=1)[source]
Compute the value of constraint.
- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The integrand of the norm Lp of the Von Mises criteria.
- Return type:
ufl.Expression
- constraint_integrand(u, lame_mu, lame_lambda, parameters)[source]
Compute the integrand of the Lp norm of the Von Mises constraint, defined as:
\[x = \left[\frac{\sigma_{VM}\left(u_{h}\right)}{\overline{\sigma_{VM}}}\right]^{p}\]with \(\sigma_{VM}\left(u_{h}\right)\) compute with the function
mecanics_tool.von_mises()and \(\overline{\sigma_{VM}}\) a constant attribut of Parameters.- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
- Returns:
The integrand of the constraint fonction.
- Return type:
ufl.Expression
- cost(u=0, p=0, lame_mu=0, lame_lambda=0, measure=0, Parameters=0)[source]
Compute the cost function, defined as :
\[J\left( \Omega \right) = \int_{\Omega} \text{ }dx\]- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The the cost value.
- Return type:
ufl.Expression
- cost_integrand(u, lame_mu, lame_lambda, Parameters)[source]
Compute the integrand of the cost function.
- Parameters:
u (fem.Function) – The displacement field, solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
- Returns:
The integrand of the norm Lp of the Von Mises criteria.
- Return type:
ufl.Expression
- dual_operator(u, lame_mu, lame_lambda, parameters, mesh, measure=0, vm_DG=0, c_k=0)[source]
Compute the dual operator.
- Parameters:
u (fem.Function) – The solution of the primal problem \(\\u_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
mesh (Mesh) – The mesh of the domaine \(D\).
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The dual linear form.
- Return type:
ufl.Expression
- shape_derivative_integrand(u, p, lame_mu, lame_lambda, parameters, measure=0)[source]
Compute the shape derivative integrand of the area constraint.
- Parameters:
u (fem.Function) – The solution of the primal problem \(\\u_{h}\).
p (fem.Function) – The solution of the dual problem \(\\p_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The integrand of the cost function.
- Return type:
ufl.Expression
- shape_derivative_integrand_constraint(u, p, lame_mu, lame_lambda, parameters, measure=0, vm_DG=0, c_k=1)[source]
Compute the shape derivative integrand of the constraint.
- Parameters:
u (fem.Function) – The solution of the primal problem \(\\u_{h}\).
p (fem.Function) – The solution of the dual problem \(\\p_{h}\).
lame_mu (float) – The \(\mu\) Lame coefficient.
lame_lambda (float) – The \(\lambda\) Lame coefficient.
parameters (Parameter) – The parameter object.
measure (Measure) – The measure on the domain \(\Omega\).
- Returns:
The integrand of the constraint function.
- Return type:
ufl.Expression