AFEPack
|
00001 00011 #ifndef __MovingMeshFB3D_h__ 00012 #define __MovingMeshFB3D_h__ 00013 00014 #include <lac/sparsity_pattern.h> 00015 #include <lac/sparse_matrix.h> 00016 #include "AMGSolver.h" 00017 #include "Geometry.h" 00018 00023 class MovingMeshFB3D : public Mesh<3,3> 00024 { 00025 public: 00026 typedef GeometryBM::bmark_t bound_t; 00027 private: 00028 std::vector<afepack::Point<3> > logical_node; 00029 double move_step_length; 00030 u_int n_move_step; 00031 std::vector<afepack::Point<3> > move_direction; 00032 std::vector<afepack::Point<3> > logical_move_direction; 00033 std::vector<float> mon; 00034 00035 u_int n_interior_node; 00036 u_int n_boundary_node; 00037 std::vector<int> index; 00038 std::vector<u_int> interior_node_index; 00039 std::vector<u_int> boundary_node_index; 00040 00041 SparsityPattern spM, spN; 00042 SparseMatrix<double> M, N; 00043 AMGSolver solver; 00044 00045 double tol; 00046 00047 public: 00048 MovingMeshFB3D(); 00049 virtual ~MovingMeshFB3D(); 00050 00051 public: 00052 const std::vector<float>& monitor() const {return mon;}; 00053 std::vector<float>& monitor() {return mon;}; 00054 const float& monitor(const u_int& i) const {return mon[i];}; 00055 float& monitor(const u_int& i) {return mon[i];} 00056 00057 const std::vector<afepack::Point<3> >& moveDirection() const {return move_direction;}; 00058 std::vector<afepack::Point<3> >& moveDirection() {return move_direction;}; 00059 const afepack::Point<3>& moveDirection(const u_int& i) const {return move_direction[i];}; 00060 afepack::Point<3>& moveDirection(const u_int& i) {return move_direction[i];}; 00061 00062 std::vector<double> moveDirection(const afepack::Point<3>& point, 00063 const int& element) const; 00064 std::vector<std::vector<double> > moveDirection(const std::vector<afepack::Point<3> >& point, 00065 const int& element) const; 00066 double moveDirectionDivergence(const u_int& element) const; 00067 00068 double moveStepLength() const {return move_step_length;}; 00069 double& moveStepLength() {return move_step_length;}; 00070 00071 u_int moveStep() const {return n_move_step;}; 00072 u_int& moveStep() {return n_move_step;}; 00073 00074 double tolerence() const {return tol;} 00075 double& tolerence() {return tol;} 00076 00077 void moveMesh(); 00078 void outputPhysicalMesh(const std::string& file); 00079 void outputLogicalMesh(const std::string& file); 00080 void readDomain(const std::string& file); 00081 00082 virtual void getMonitor(); 00083 virtual void smoothMonitor(u_int step = 1); 00084 virtual void updateMesh(); 00085 virtual void updateSolution() = 0; 00086 virtual void outputSolution() = 0; 00087 virtual void getMoveStepLength(); 00088 virtual void getLogicalMesh(); 00089 00090 private: 00091 void getMoveDirection(); 00092 void readDummy(std::ifstream& is); 00093 }; 00094 00095 #endif