1 /** @file gsALE.h
2 
3     @brief Implementation of mesh deformation method for partitioned FSI solver.
4 
5     This file is part of the G+Smo library.
6 
7     This Source Code Form is subject to the terms of the Mozilla Public
8     License, v. 2.0. If a copy of the MPL was not distributed with this
9     file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11     Author(s):
12         A.Shamanskiy (2016 - ...., TU Kaiserslautern)
13 */
14 
15 #pragma once
16 #include <gsIO/gsOptionList.h>
17 #include <gsElasticity/gsBaseUtils.h>
18 #include <gsCore/gsMultiPatch.h>
19 #include <gsElasticity/gsIterative.h>
20 #include <gsElasticity/gsBaseAssembler.h>
21 
22 namespace gismo
23 {
24 
25 template <class T>
26 class gsBaseAssembler;
27 template <class T>
28 class gsIterative;
29 
30 template <class T>
31 class gsALE
32 {
33 public:
34     gsALE(gsMultiPatch<T> & geometry, const gsMultiPatch<T> & displacement,
35           const gsBoundaryInterface & interfaceStr2Mesh, ale_method::method method);
36 
37     /// default option list. used for initialization
38     static gsOptionList defaultOptions();
39 
40     /// get options list to read or set parameters
options()41     gsOptionList & options() { return m_options; }
42 
43     /// number of degrees of freedom
numDofs()44     index_t numDofs() const {return assembler->numDofs();}
45 
46     /// construct ALE displacement field
47     void constructSolution(gsMultiPatch<T> & solution) const;
48 
49     /// update mesh to comply with the current displacement field
50     index_t updateMesh();
51 
52     /// save module state
53     void saveState();
54 
55     /// recover module state from saved state
56     void recoverState();
57 
58     /// get FSI interface container to access patch sides
interface()59     const gsBoundaryInterface & interface() { return m_interface;}
60 
61 protected:
62     void initialize();
63 
64     /// update mesh using HE, LE or BHE methods
65     index_t linearMethod();
66 
67     /// update mesh using IHE, ILE or IBHE methods
68     index_t linearIncrementalMethod();
69 
70     /// update mesh using TINE or TINE_StVK methods
71     index_t nonlinearMethod();
72 
73 protected:
74     /// outer displacement field that drives the mesh deformation
75     const gsMultiPatch<T> & disp;
76     /// mapping between patch sides of the fluid and solid
77     const gsBoundaryInterface & m_interface;
78     /// mesh deformation method
79     ale_method::method methodALE;
80     /// option list
81     gsOptionList m_options;
82     /// assembler
83     typename gsBaseAssembler<T>::uPtr assembler;
84     /// nonlinear solver
85     typename gsIterative<T>::uPtr solverNL;
86     /// current ALE displacement field
87     gsMultiPatch<T> ALEdisp;
88     /// initialization flag
89     bool initialized;
90 
91 
92     /// saved state
93     bool hasSavedState;
94     gsMultiPatch<T> ALEdispSaved;
95 };
96 
97 } // namespace ends
98 
99 #ifndef GISMO_BUILD_LIB
100 #include GISMO_HPP_HEADER(gsALE.hpp)
101 #endif
102