A (model-free) Data-driven implementation based on fenics (https://github.com/felipefr/ddfenics). This version is compatible with Fenicsx 0.10.
Aim: Solve a simple 2D bar problem using standard Fenicsx and DDFenicsx.
-
- 2D bar (linear elastic) in FEniCsx: tutorial/linear/main_bar.ipynb
-
- 2D bar (linear elastic) in DDFenics(x) (Hands-on): tutorial/linear/main_bar_dd_to_fill.ipynb
- Complete the "missing lines" (commented in the notebook)
- Plot the convergence (with data) curves
- Run the sanity-check (last block of notebook) and redo DDCM
- Change C = some isotropic elastic tensor (hookean) for changed (E', nu') ?
-
- 2D bar (nonlinear elastic) in FEniCsx: tutorial/nonlinear/main_bar_nonlinear.ipynb
-
- 2D bar (nonlinear elastic) in DDFenics(x): tutorial/nonlinear/main_bar_nonlinear_dd.ipynb
DDFenics relies on the following fenicsx 0.10 and the standard fenicsx and python tools for pre-processing and post-processing: matplotlib, pyvista, python-gmsh, meshio. Aditionally, scikit-learn is needed for nearest neighbour search. Please consider conda installation with conda-forge as a first choice, and then pip, if the library is not available in conda.
-
Map between Galerkin-like variational approximation and FEniCs objects.

-
Map between FEniCs and the corresponding objects in DDFenics.

-
Map between (Model-free) Data-driven formulation and the corresponding objects in DDFenics.

There two modes of usage:
-
(intrusive) The usage mimetises the basic framework of fenicsx by defining Data-driven equivalents of the Problem and Solver objects, respectively DDProblem and DDSolver. Additionally the DDProblem object depends on a Data-driven material (raw dataset instead of a constitutive equation), which is defined by an instance of a DDMaterial. The output of the DD solver also contains the mechanical and neighrest projections (in the material database) states, which are instances of DDFunction.
-
(non-intrusive (still not provided) ) This mode is designed to be used with an user-defined FEM solver. Fenicsx are still needed in some utilitary classes. The assembling related functions should be provided by the user. Here, we provide a example, using Fenicsx for the sake of convenience.
- Definition of standard constitutive equations.
- Definition of mesh, FE spaces, boundary conditions, variational forms, etc.
- Variational problem definition: problem = LinearVariationalProblem(a, b, uh, bcs)
- Solve the problem
- Definition of Data-driven constitutive equations : loading of material datasets and definition of an approximative metric ==> ddmat = DDMaterial(DB, Metric)
- Definition of mesh, FE spaces, boundary conditions, standard constitutive equations, variational forms, etc. (idem)
- Definition of Gauss-Point spaces where the material states live : Sh0 = DDSpace(Uh.mesh(), 'DG', degree = 0 , dim = 3). Stresses and strains are instances of DDFunction(Sh0).
- DD Variational problem definition: problem = DDProblem(a, b, uh, bcs, ddmat, ddmat, state_mech, state_db) (almost idem)
- Solve the problem: definition of DDSolver(problem, solver_args) then solve the problem (idem)
- Definition of Data-driven constitutive equations : loading of material datasets and definition of an approximative metric ==> ddmat = DDMaterial(DB, Metric)
- Definition of Assembling routines and linear solver routines.
- Definition of Gauss-Point spaces where the material states live : Sh0 = DDSpace(Uh.mesh(), 'DG', degree = 0 , dim = 3). Stresses and strains are instances of DDFunction(Sh0).
- DD Variational problem definition: problem = DDProblem(a, b, uh, bcs, ddmat, ddmat, state_mech, state_db) (almost idem)
- Solve the problem: definition of DDSolver(problem, solver_args) then solve the problem (idem)
Don't hesitate in contact me via felipe.figueredo-rocha@u-pec.fr.
Please cite this repository if this library has been useful for you.