📄 u_h.h
字号:
#ifndef __U_H_H
#define __U_H_H
//==============================================================================
// Part B: classes of free and fixed variables// gh_on_Gamma_h (boundary conditions)// U_h free variables//==============================================================================class Nodal_Constraint : public Nodal_Value { int* constraint_flag; // Neumann B.C. = 0; Dirichlet B.C. = 1public: Nodal_Constraint(int nn, int ndf, double* value = NULL, int* flag = NULL); ~Nodal_Constraint() { delete [] constraint_flag; } Nodal_Constraint(const Nodal_Constraint&); Nodal_Constraint& operator=(const Nodal_Constraint&); int& operator()(int i) { return constraint_flag[i]; }};class gh_on_Gamma_h { // Boundary Condition := { u_h = g and f = h on Gamma_h }protected: int total_node_no, ndf; Dynamic_Array<Nodal_Constraint> the_gh_array;public: void __initialization(int, Omega_h&); enum { Neumann = 0, Dirichlet }; gh_on_Gamma_h(int = 0) { /*do nothing*/ } // default constructor for Global_Discretization gh_on_Gamma_h(int df, Omega_h& oh); // constructor for customized problem definition virtual ~gh_on_Gamma_h() {}; Dynamic_Array<Nodal_Constraint>& gh_array() { return the_gh_array; } Nodal_Constraint& operator[](int node_no); int node_order(int nn);};class Matrix_Representation;class U_h { // Nodal Variable is the "Basis" of finite element approximation int the_total_node_no, ndf; Matrix_Representation *mr; Dynamic_Array<Nodal_Value> the_u_h_array;public: void __initialization(int, Omega_h&); U_h(int) { /* do nothing */ } // default constructor for Global_Discretization U_h(int df, Omega_h& oh) { __initialization(df, oh); } virtual ~U_h() {} Dynamic_Array<Nodal_Value>& u_h_array() { return the_u_h_array; } Nodal_Value& operator[](int nn); int u_h_order(int nn); int total_node_no() const { return the_total_node_no; } U_h& operator=(gh_on_Gamma_h& gh); Matrix_Representation* &matrix_representation() { return mr; } operator C0(); // to be defined in constructor of Matrix_Representation to close cyclic dependency U_h& operator=(C0&); U_h& operator+=(C0&); U_h& operator-=(C0&); friend ostream& operator<<(ostream&, U_h&);};//==============================================================================// an integrated class of Part A and B// --a "strong component design class" in Graph Theory//==============================================================================class Global_Discretization { Global_Discretization *type_id; Omega_h &the_omega_h; U_h &the_u_h; gh_on_Gamma_h &the_gh_on_gamma_h;public: Global_Discretization(Omega_h& oh = Omega_h(0), gh_on_Gamma_h& gh = gh_on_Gamma_h(0), U_h& uh = U_h(0), Global_Discretization *id = 0) : the_omega_h(oh), the_gh_on_gamma_h(gh), the_u_h(uh), type_id(id){} Global_Discretization(const Global_Discretization& a) : the_omega_h(a.the_omega_h), the_u_h(a.the_u_h), the_gh_on_gamma_h(a.the_gh_on_gamma_h), type_id(a.type_id) {} virtual ~Global_Discretization() {} Global_Discretization& operator=(const Global_Discretization&); virtual Omega_h& omega_h() { return the_omega_h; } virtual Omega_h omega_h() const { return the_omega_h; } U_h& u_h() { return the_u_h; } U_h u_h() const { return the_u_h; } gh_on_Gamma_h& gh_on_gamma_h() { return the_gh_on_gamma_h; } gh_on_Gamma_h gh_on_gamma_h() const { return the_gh_on_gamma_h; } virtual Global_Discretization* type() { return type_id; } virtual Global_Discretization* type() const { return type_id; } virtual C0 element_coordinate(int en); // integrated-information services to Element_Formulation virtual C0 element_fixed_variable(int en); virtual C0 element_free_variable(int en); virtual C0 element_nodal_force(int en);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -