pyxfem.solidmechanics.exact_solutions module

This file contains exact solutions to some classic pde problems

Use full to test convergence Created on Wed Feb 28 09:49:32 2024 @author: nchevaug

class pyxfem.solidmechanics.exact_solutions.LaplacianCircularInclusionQuad(k1, k2, ri=0.4, re=np.float64(1.4142135623730951))[source]

Bases: LaplacianGeneral

Circular inclusion, with quadratic solution

u equal zero at re, source term ‘s = 1.’ is constant, 2 conductivity : k1 inside, k2 outside

class pyxfem.solidmechanics.exact_solutions.LaplacianCircularInclusionQuintic(k1, k2, ri=0.4, re=np.float64(1.4142135623730951))[source]

Bases: LaplacianGeneral

Circular inclusion with order 5 displacement source (r-re)**3

class pyxfem.solidmechanics.exact_solutions.LaplacianGeneral(lsfuncs=None, classifyer=None, filt=0, conductivity=None, source=None, BNDDefinition=None, DirichletBCs=None, NeumannBCs=None, exactSolution=None, exactGradient=None)[source]

Bases: object

Base class for the definition of Laplacian type problem and its exact solution

get_conductivity_val()[source]

return a dictionary of conductivity values

get_dirichlet_bc_val()[source]

return a dictionary of boundary name to dirichlet value

get_exact_grad()[source]

return the gradient exact solution of the problem

get_exact_sol()[source]

return the exact solution of the problem

get_ls()[source]

get The level-set function used to define the problem (when multiple conductiviies are present )

get_neumann_bc_val()[source]

return a dictionary of boundary name to neumann value

get_source_term()[source]

return the souce term associated to the problem

class pyxfem.solidmechanics.exact_solutions.LaplacianSquareHole(a=0.4)[source]

Bases: LaplacianGeneral

Manufactured solution : square with a square hole

+–+ | | +–+

class pyxfem.solidmechanics.exact_solutions.LinearElasticity2dCircularHoleInfiniteSpace(mat: LinearIsotropeElasticMaterial, r=0.5, p=1.0)[source]

Bases: LinearElasticityExacSol

linear Elasticity exact solution : hole in a plate

ddf(z)[source]

fist derivative of the complex potential f evaluation

ddg(z)[source]

second derivative of the complex potential g evaluation

df(z)[source]

fist derivative of the complex potential f evaluation

dg(z)[source]

fist derivative of the complex potential g evaluation

displacement(xy)[source]

return the displacement value at each position xy

f(z)[source]

complex potential f evaluation

strain(xy, dim=2)[source]

return the displacement field

if dim = 2 return array shape is (..,2,2) if dim = 3 return array shape is (..,3,3)

stress(xy, dim=2)[source]

return the stress field

if dim = 2 return array shape is (..,2,2) if dim = 3 return array shape is (..,3,3)

class pyxfem.solidmechanics.exact_solutions.LinearElasticityExacSol[source]

Bases: ABC

Base class for exact solution of linear elasticity problems

abstractmethod displacement(xy)[source]

Return the displacement at each point in the xy input array input array of float such as […, :] contain the x and y coordinate of the point. return an array of the sameshape containing the displacement at the input point

abstractmethod strain(xy)[source]

Return the displacement at each point in the xy input array input array of float such as […, :] contain the x and y coordinate of the point. return an array of shape xy.shape[:-1] + (2,2) containing the 2d strain.

abstractmethod stress(xy)[source]

Return the displacement at each point in the xy input array input array of float such as […, :] contain the x and y coordinate of the point. return an array of shape xy.shape[:-1] + (2,2) containing the 2d stress.

class pyxfem.solidmechanics.exact_solutions.WilliamsExpansion(mat, A=None, B=None)[source]

Bases: object

Exact field from williams expansion (crack tip is at (0,0), x axis aligned with the crack)

^ y | |

______o—> x crack

displacement(xy)[source]

Compute the displacement at xy

strain(xy)[source]

Compute the stress at xy

stress(xy)[source]

Compute the stress at xy

pyxfem.solidmechanics.exact_solutions.elasticity_hole_in_plate(popUpGmsh=False)[source]

test exactSolutions.linearElasticity2dCircularHoleInfiniteSpace and plot it

pyxfem.solidmechanics.exact_solutions.laplacian_inclusion(exactsolbuilder, popUpGmsh=False)[source]

plot exact solution for laplacien with 2 conductivities on a mesh

class pyxfem.solidmechanics.exact_solutions.testAnaly(methodName='runTest')[source]

Bases: TestCase

testing Analytical solutions

testElasticityHoleInPlate(popUpGmsh=False)[source]
  • Compute max exact stress on mesh nodes and compare to ref value

testLaplacianCircularInclusionQuad(popUpGmsh=False)[source]
  • Compute max Temperature on mesh nodes and compare to ref value

testLaplacianCircularInclusionQuintic(popUpGmsh=False)[source]
  • Compute max Temperature on mesh nodes and compare to ref value