v0.15.0
Loading...
Searching...
No Matches
MFrontInterface.hpp
Go to the documentation of this file.
1/** \file MFrontInterface.hpp
2 * \brief MFrontInterface
3 *
4 * This file defines the MFrontInterface base class, which provides
5 * an interface for integrating MFront material models with MoFEM.
6 * Derived class templates handle specific model hypotheses (plane strain,
7 * axisymmetrical, 3D) and assembly types (PETSc, Schur blocks).
8 *
9 * \ingroup mfront
10 */
11
12#ifndef __MFRONT_INTERFACE_HPP__
13#define __MFRONT_INTERFACE_HPP__
14
15namespace MoFEM {
16
17/**
18 * @brief Interface for integrating MFront material models with MoFEM.
19 *
20 * This class defines a set of pure virtual methods that must be implemented
21 * by derived classes to handle various operations such as setting monitors,
22 * creating operators, and updating internal variables.
23 */
25public:
26 virtual ~MFrontInterface() = default;
27 /**
28 * @brief Retrieve command-line parameters for the interface.
29 */
30
32
33 /**
34 * @brief Set a monitor for the interface.
35 * @param monitor_ptr Shared pointer to the FEMethod monitor.
36 */
37 virtual MoFEMErrorCode
38 setMonitor(boost::shared_ptr<MoFEM::FEMethod> monitor_ptr) = 0;
39
40 /**
41 * @brief Push domain operators for the right-hand side (RHS).
42 * @param pip pipeline to push the operators into.
43 * @param field_name Name of the field associated with displacement.
44 */
46 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
47 std::string field_name) = 0;
48
49 /**
50 * @brief Push domain operators for the left-hand side (LHS).
51 * @param pip pipeline to push the operators into.
52 * @param field_name Name of the field associated with displacement.
53 */
55 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
56 std::string field_name) = 0;
57
58 /**
59 * @brief Set operators for updating internal variables using internal
60 * pipeline.
61 * @param rule Hook function defining the integration rule
62 * @param field_name Name of the field associated with displacement.
63 */
64 virtual MoFEMErrorCode
66 std::string field_name) = 0;
67
68 /**
69 * @brief Set operators for post-processing using internal pipeline.
70 * @param rule Hook function defining the integration rule.
71 * @param fe_name Name of the domain finite element.
72 * @param field_name Name of the field associated with displacement.
73 * @param order Approximation order for L2 projection
74 */
75 virtual MoFEMErrorCode
77 std::string fe_name, std::string field_name,
78 int order) = 0;
79
80 /**
81 * @brief Loop internal pipeline to update internal variables at each Gauss
82 * point.
83 * @param dm SmartPetscObj
84 * @param fe_name Name of the domain finite element.
85 */
87 std::string fe_name) = 0;
88
89 /**
90 * @brief Perform post-processing for displacement, strain and stress.
91 * @param step Current time step.
92 * @param dm SmartPetscObj
93 * @param fe_name Name of the domain finite element.
94 */
96 string fe_name) = 0;
97
98 /**
99 * @brief Structure to hold common data shared across the operators.
100 */
101 struct CommonData;
102};
103
105
106/**
107 * @brief Enumeration of model hypotheses supported by MFront interface
108 */
110 TRIDIMENSIONAL, ///< 3D model hypothesis.
111 PLANESTRAIN, ///< Plane strain model hypothesis.
112 AXISYMMETRICAL ///< Axisymmetrical model hypothesis.
114
115/**
116 * @brief create mfront interface
117 *
118 * @param m_field
119 * @param mh model hypothesis (TRIDIMENSIONAL, PLANESTRAIN, AXISYMMETRICAL)
120 * @param at assembly type (PETSC, SCHUR, BLOCK_MAT, BLOCK_SCHUR,)
121 * @return boost::shared_ptr<MFrontInterface>
122 */
123boost::shared_ptr<MFrontInterface>
126
127} // namespace MoFEM
128
129#endif // __MFRONT_INTERFACE_HPP__
Interface for integrating MFront material models with MoFEM.
virtual ~MFrontInterface()=default
virtual MoFEMErrorCode setMonitor(boost::shared_ptr< MoFEM::FEMethod > monitor_ptr)=0
Set a monitor for the interface.
virtual MoFEMErrorCode setUpdateInternalVariablesOperators(ForcesAndSourcesCore::RuleHookFun rule, std::string field_name)=0
Set operators for updating internal variables using internal pipeline.
virtual MoFEMErrorCode postProcess(int step, SmartPetscObj< DM > dm, string fe_name)=0
Perform post-processing for displacement, strain and stress.
virtual MoFEMErrorCode getCommandLineParameters()=0
Retrieve command-line parameters for the interface.
virtual MoFEMErrorCode opFactoryDomainLhs(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name)=0
Push domain operators for the left-hand side (LHS).
virtual MoFEMErrorCode setPostProcessOperators(ForcesAndSourcesCore::RuleHookFun rule, std::string fe_name, std::string field_name, int order)=0
Set operators for post-processing using internal pipeline.
virtual MoFEMErrorCode updateInternalVariables(SmartPetscObj< DM > dm, std::string fe_name)=0
Loop internal pipeline to update internal variables at each Gauss point.
virtual MoFEMErrorCode opFactoryDomainRhs(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name)=0
Push domain operators for the right-hand side (RHS).
constexpr int order
AssemblyType
[Storage and set boundary conditions]
@ PETSC
Standard PETSc assembly.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
boost::shared_ptr< MFrontInterface > createMFrontInterface(MoFEM::Interface &m_field, ModelHypothesis mh, AssemblyType at=AssemblyType::PETSC)
create mfront interface
ModelHypothesis
Enumeration of model hypotheses supported by MFront interface.
@ AXISYMMETRICAL
Axisymmetrical model hypothesis.
@ PLANESTRAIN
Plane strain model hypothesis.
@ TRIDIMENSIONAL
3D model hypothesis.
constexpr auto field_name
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
boost::function< int(int order_row, int order_col, int order_data)> RuleHookFun
intrusive_ptr for managing petsc objects