Skip to content

felipefr/ddfenics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DDFenics (X)

A (model-free) Data-driven implementation based on fenics (https://github.com/felipefr/ddfenics). This version is compatible with Fenicsx 0.10.

Tutorial

Aim: Solve a simple 2D bar problem using standard Fenicsx and DDFenicsx.

    1. 2D bar (linear elastic) in FEniCsx: tutorial/linear/main_bar.ipynb
    1. 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') ?
    1. 2D bar (nonlinear elastic) in FEniCsx: tutorial/nonlinear/main_bar_nonlinear.ipynb
    1. 2D bar (nonlinear elastic) in DDFenics(x): tutorial/nonlinear/main_bar_nonlinear_dd.ipynb

Installation and Requirements

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.

Documentation [Maybe deprecated]

  1. Map between Galerkin-like variational approximation and FEniCs objects. FenicsContinuum

  2. Map between FEniCs and the corresponding objects in DDFenics. FenicsDDFenics

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

Basic Usage

There two modes of usage:

  1. (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.

  2. (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.

Fenicsx

  1. Definition of standard constitutive equations.
  2. Definition of mesh, FE spaces, boundary conditions, variational forms, etc.
  3. Variational problem definition: problem = LinearVariationalProblem(a, b, uh, bcs)
  4. Solve the problem

DDFenics(x) (intrusive)

  1. Definition of Data-driven constitutive equations : loading of material datasets and definition of an approximative metric ==> ddmat = DDMaterial(DB, Metric)
  2. Definition of mesh, FE spaces, boundary conditions, standard constitutive equations, variational forms, etc. (idem)
  3. 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).
  4. DD Variational problem definition: problem = DDProblem(a, b, uh, bcs, ddmat, ddmat, state_mech, state_db) (almost idem)
  5. Solve the problem: definition of DDSolver(problem, solver_args) then solve the problem (idem)

DDFenics(x) (non-intrusive - it should be improved, still not provided)

  1. Definition of Data-driven constitutive equations : loading of material datasets and definition of an approximative metric ==> ddmat = DDMaterial(DB, Metric)
  2. Definition of Assembling routines and linear solver routines.
  3. 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).
  4. DD Variational problem definition: problem = DDProblem(a, b, uh, bcs, ddmat, ddmat, state_mech, state_db) (almost idem)
  5. Solve the problem: definition of DDSolver(problem, solver_args) then solve the problem (idem)

Contact and Citing

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. DOI

About

a FEniCs-based (Model-Free) Data-driven Computational Mechanics implementation

Resources

License

Stars

13 stars

Watchers

2 watching

Forks

Packages

 
 
 

Contributors