Replies: 11 comments 1 reply
-
I think a collection; the integrations serve diverse ends. For pytest, I've seen this idiom: netCDF4 = pytest.importorskip("netCDF4") |
Beta Was this translation helpful? Give feedback.
-
So basically in practice we could have have something like |
Beta Was this translation helpful? Give feedback.
-
Yes, I think so. That directory structure should make it easy to find the case of interest. Is there a catch with trying to |
Beta Was this translation helpful? Give feedback.
-
Yeah, let's call them |
Beta Was this translation helpful? Give feedback.
-
Here are some integrations that come to mind:
I'm sure there are others. Feel free to add to the list. Edit: I'm sure there are also those that might be hard to test in our test suite such as reading a mesh from FEniCS or ngsolve. Not sure if we should include those or only what we are willing to test? |
Beta Was this translation helpful? Give feedback.
-
Some additional urls for consideration: |
Beta Was this translation helpful? Give feedback.
-
There's a start on PETSc in #236 . After that recent question about pressure boundary conditions for the Stokes equation #466 , which referred to a FEniCS example using MUMPS, I started looking at PyMumps. nschloe has a new package picking up from krypy: Krylov. I've been looking at pyMOR; besides it being useful for scikit-fem applications, I think scikit-fem.could be useful for it. It has bindings to FEniCS, deal.ii, and NGSolve, and its own little pythonic FEM implementation but that's rather limited. I like the idea of coupling to a finite volume solver. For finite differences, there's scikit-fdiff. A boundary element code could be really useful too. |
Beta Was this translation helpful? Give feedback.
-
I had been that thinking optimesh might be useful with the new |
Beta Was this translation helpful? Give feedback.
-
I think that in near future I might be reimplementing one specific
algorithm from optimesh that I'm very fond of and also using in
https://github.com/kinnala/adaptmesh.
|
Beta Was this translation helpful? Give feedback.
-
For external reasons but possibly of interest here, I've posted an example of integration with OpenFOAM. It generates a quasi-two-dimensional hexahedral mesh using OpenFOAM's The creation of the |
Beta Was this translation helpful? Give feedback.
-
Hi, as a quick follow-up from #839 here is a minimal-modified version of example 43 with a hyperelastic Neo-Hookean material formulation defined by matADi ( scikit-fem with matadiimport numpy as np
from skfem import *
from skfem.helpers import grad, identity
from matadi import MaterialHyperelastic
from matadi.models import neo_hooke
umat = MaterialHyperelastic(fun=neo_hooke, C10=0.5, bulk=2.0)
mesh = MeshHex().refined(2).with_boundaries({
'left': lambda x: x[0] == 0.,
'right': lambda x: x[0] == 1.,
})
element = ElementVector(ElementHex1())
basis = Basis(mesh, element, intorder=1)
u = basis.zeros()
dofs = basis.get_dofs('right')
dirichlet = basis.get_dofs({'right', 'left'})
active = basis.complement_dofs(dirichlet)
Eye = identity(grad(basis.interpolate(u)))
F = grad(basis.interpolate(u)) + Eye
@LinearForm
def L(v, w):
return umat.gradient_vector_product([F], [grad(v)])[0]
@BilinearForm
def a(u, v, w):
return umat.hessian_vector_product([F], [grad(v)], [grad(u)])[0]
b = None
right = -0.5
for iteration in range(8):
K = a.assemble(basis)
du_D = u.copy()
du_D[dofs.nodal['u^1']] -= right
u += solve(*condense(K, b, x=-du_D, D=dirichlet))
F = grad(basis.interpolate(u)) + Eye
b = -L.assemble(basis)
norm_f = np.linalg.norm(-b[active])
print(1 + iteration, norm_f)
if norm_f < 1e-10:
break output: 1 0.2313927273813761
2 0.018997771204881598
3 4.554610746120609e-05
4 7.916934983340329e-09
5 7.069702684553263e-16 |
Beta Was this translation helpful? Give feedback.
-
I'd like to keep a track of the libraries that can be integrated to scikit-fem with ease. How about having a single example which simply demonstrates the possible integrations? Or should it be a collection of snippets instead? If the latter, how is it tested in pytest?
Beta Was this translation helpful? Give feedback.
All reactions