• Benoît LÉ's avatar
    [xInterfaceMatlib] Add xInterfaceMatlib · b9a90544
    Benoît LÉ authored
    Based on work initiated by G. Legrain.
    
    Interface between eXlibris and Matlib material library ("lite" version can be  downloaded here:
    https://git.gem.ec-nantes.fr/MatLib/Lite).
    
    To compile this interface:
    
    1) Download and compile Matlib. It must be compiled using the add_definitions( -DMATLIB_USE_MATLIB_NAMESPACE)
    
    2) Install Matlib in a /my/path/to/matlib/ such that libraries are installed in /my/path/to/matlib/lib and
    include in /my/path/to/matlib/include. Path to sources /my/path/to/matlib/src will also be necessary
    
    3) Add
    
    if(USE_MATLIB)
        set(MATLIB_PATH "/my/path/to/matlib/src will also be necessary"  CACHE INTERNAL "Matlib install path")#
    endif(USE_MATLIB)
    
    to the LocalConfig.cmake file. The line "is_not_installed ( USE_MATLIB )" (which is by default activated in the
     template LocalConfig.cmake of GeMUtil) may eventually need to be commented
    
    4) Set BUILD_XINTERFACE_MATLIB and USE_MATLIB to "ON" in the main CMakeLists.txt
    
    5) (Try to) compile !
    
    To use it in In your code:
    
    1) You need to declare a
    
    xinterface::aomd::xAttachedDataManagerAOMD<std::vector<xinterface::matlibinterface::xMaterialTwoStates>>
    
    which will store some xMaterialTwoStates at each Gauss points
    
    2) Each xMaterialTwoStatesInterface (defined in) contains two matlib::MaterialState, corresponding to the previous
    and current material state
    
    3) Still in xMaterialTwoStatesInterface.h, you will find classes to manipulate theses states. In particular, some
    important classes are:
      - xInitVectorMatLibTwoStatesToAttachedDataManagerAOMD: must be used with an ApplyCommandOnIntegration rule to
      initialize the states
      - xMatLibStandardMaterialStateUpdatorVectorTwoStates: to update the material states at each Gauss points
      - xMatLibLipschitzMaterialStateUpdator: same, but update only softening variables, in the framework of the Lipfield
       regularization (an appli illustrating the implementation of the Lipfield approach should come soon)
      - xEvalVectorMatLibStandardMaterialTangent: evaluator of the material tangent
    
    4) xEvalFromMatlib.h contains several evaluators to access the quantities stored at GaussPoints and use them in eXlibris.
    For now they can be used to access scalar or tensorial matlib gradients, fluxes and internal variables (maybe evaluators
    corresponding to vectorial quantities should be added ?)
    
    5) xInterfaceMatlibToExlibris.h contains classes which are used by the previously mentionned classes. Basically, provides
    sgome tools to read and/or write from/to matlib arrays
    
    6)  xMatlibHelpers.h some helper functions to parse a material file and create Matlib objects
    
    Note that for objects dealing with tensor 2 or 4 (example : xEvalVectorMatLibStandardMaterialTangent, evaluators in
    xEvalFromMatlib.h), some builder functions are provide to instanciate the correct template object, which depends on the
    problem dimension. In the case of the xEvalVectorMatLibStandardMaterialTangent, it can be used directly inside your main
    appli (but special care must be given to the problem dimension), otherwise a xFormBilinearMatLibStandardMaterialTangentFactory
    is provided in the interface to create the corresponding bilinear form (which is btw the only thing which is necessary in most
    cases).
    b9a90544