v0.14.0
CPSolvers.hpp
Go to the documentation of this file.
1 /** \file CPSolvers.hpp
2  \brief Solvers for crack propagation
3 */
4 
5 /* This file is part of MoFEM.
6  * MoFEM is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
18 
19 #ifndef __CP_SOLVERS_HPP__
20 #define __CP_SOLVERS_HPP__
21 
22 namespace FractureMechanics {
23 
24 
25 /**
26  * Crack propagation solvers
27  */
29 
30  /**
31  * \brief Getting interface of core database
32  * @param uuid unique ID of interface of CPSolvers solely
33  * @param iface returned pointer to interface
34  * @return error code
35  */
36  MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
37  MoFEM::UnknownInterface **iface) const;
38 
41  virtual ~CPSolvers() {}
42 
44 
45  /**
46  * @brief Solve elastic problem
47  *
48  * @param dm_elastic
49  * @return MoFEMErrorCode
50  */
51  MoFEMErrorCode solveElastic(DM dm_elastic, Vec init,
52  const double load_factor);
53 
54  /**
55  * @brief Solve for energy realease rate
56  *
57  * @param dm_material_forces
58  * @param dm_surface_projection
59  * @param dm_crack_srf_area
60  * @param surface_ids
61  * @return MoFEMErrorCode
62  */
63  MoFEMErrorCode calculateGc(DM dm_material_forces, DM dm_surface_projection,
64  DM dm_crack_srf_area,
65  const std::vector<int> &surface_ids);
66 
67  /**
68  * @brief Solve crack propagation problem
69  *
70  * @param dm_crack_propagation composition of elastic DM and material DM
71  * @param dm_elastic elastic DM
72  * @param dm_material material DM
73  * @param dm_material_forces used to calculate material forces, sub-dm of
74  * dm_crack_propagation
75  * @param dm_surface_projection dm to project material forces on surfaces,
76  * sub-dm of dm_crack_propagation
77  * @param dm_crack_srf_area dm to project material forces on crack
78  * surfaces, sub-dm of dm_crack_propagation
79  * @param surface_ids IDs of surface meshsets
80  * @param cut_mesh_it number of catting steps
81  * @param set_cut_surface flag to cut surfaces
82  *
83  * @return MoFEMErrorCode
84  */
86  solvePropagation(DM dm_crack_propagation, DM dm_elastic, DM dm_material,
87  DM dm_material_forces, DM dm_surface_projection,
88  DM dm_crack_srf_area, const std::vector<int> &surface_ids,
89  int cut_mesh_it = 0, const bool set_cut_surface = false);
90 
91  /**
92  * @brief Solve cutting mesh problem
93  * @param dm_crack_propagation composition of elastic DM and material DM
94  * @param dm_elastic elastic DM
95  * @param dm_eigen_elastic eigen elastic DM
96  * @param dm_material material DM
97  * @param dm_material_forces used to calculate material forces, sub-dm of
98  * dm_crack_propagation
99  * @param dm_surface_projection dm to project material forces on surfaces,
100  * sub-dm of dm_crack_propagation
101  * @param dm_crack_srf_area dm to project material forces on crack
102  * surfaces, sub-dm of dm_crack_propagation
103  * @param surface_ids IDs of surface meshsets
104  * @param debug flag for debugging
105  *
106  * @return MoFEMErrorCode
107  */
108  MoFEMErrorCode solveCutMesh(SmartPetscObj<DM> &dm_crack_propagation,
109  SmartPetscObj<DM> &dm_elastic,
110  SmartPetscObj<DM> &dm_eigen_elastic,
111  SmartPetscObj<DM> &dm_material,
112  SmartPetscObj<DM> &dm_material_forces,
113  SmartPetscObj<DM> &dm_surface_projection,
114  SmartPetscObj<DM> &dm_crack_srf_area,
115  std::vector<int> &surface_ids,
116  const bool debug = false);
117 };
118 }
119 
120 #endif // __CP_SOLVERS_HPP__
121 
FractureMechanics::CPSolvers::~CPSolvers
virtual ~CPSolvers()
Definition: CPSolvers.hpp:41
FractureMechanics::CPSolvers::CPSolvers
CPSolvers(CrackPropagation &cp)
Definition: CPSolvers.cpp:56
FractureMechanics::CPSolvers::solveElastic
MoFEMErrorCode solveElastic(DM dm_elastic, Vec init, const double load_factor)
Solve elastic problem.
Definition: CPSolvers.cpp:90
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
FractureMechanics::CPSolvers::calculateGc
MoFEMErrorCode calculateGc(DM dm_material_forces, DM dm_surface_projection, DM dm_crack_srf_area, const std::vector< int > &surface_ids)
Solve for energy realease rate.
Definition: CPSolvers.cpp:186
FractureMechanics::CPSolvers::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, MoFEM::UnknownInterface **iface) const
Getting interface of core database.
Definition: CPSolvers.cpp:50
FractureMechanics::CPSolvers::getOptions
MoFEMErrorCode getOptions()
Definition: CPSolvers.cpp:80
debug
static const bool debug
Definition: dm_create_subdm.cpp:12
FractureMechanics::CPSolvers::solvePropagation
MoFEMErrorCode solvePropagation(DM dm_crack_propagation, DM dm_elastic, DM dm_material, DM dm_material_forces, DM dm_surface_projection, DM dm_crack_srf_area, const std::vector< int > &surface_ids, int cut_mesh_it=0, const bool set_cut_surface=false)
Solve crack propagation problem.
Definition: CPSolvers.cpp:247
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
FractureMechanics::CPSolvers::solveCutMesh
MoFEMErrorCode solveCutMesh(SmartPetscObj< DM > &dm_crack_propagation, SmartPetscObj< DM > &dm_elastic, SmartPetscObj< DM > &dm_eigen_elastic, SmartPetscObj< DM > &dm_material, SmartPetscObj< DM > &dm_material_forces, SmartPetscObj< DM > &dm_surface_projection, SmartPetscObj< DM > &dm_crack_srf_area, std::vector< int > &surface_ids, const bool debug=false)
Solve cutting mesh problem.
Definition: CPSolvers.cpp:850
FractureMechanics::CPSolvers
Definition: CPSolvers.hpp:28
FractureMechanics::CrackPropagation
Definition: CrackPropagation.hpp:77
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
FractureMechanics
Definition: AnalyticalFun.hpp:15
FractureMechanics::CPSolvers::cP
CrackPropagation & cP
Definition: CPSolvers.hpp:39
convert.init
def init(l)
Definition: convert.py:55