Skip to main content

Methods

ConvectiveMatrix 1​

Interface:

  MODULE PURE FUNCTION ConvectiveMatrix(test, trial, term1, &
& term2, opt) RESULT(Ans)
CLASS(ElemshapeData_), INTENT(IN) :: test
CLASS(ElemshapeData_), INTENT(IN) :: trial
INTEGER(I4B), INTENT(IN) :: term1
!! del_x, del_y, del_z, del_x_all, del_none
INTEGER(I4B), INTENT(IN) :: term2
!! del_x, del_y, del_z, del_x_all, del_none
INTEGER( I4B ), OPTIONAL, INTENT( IN ) :: opt
!! Option for number of diagonal copies
REAL(DFP), ALLOCATABLE :: ans(:, :)
END FUNCTION ConvectiveMatrix

Following matrices can be calculated based on the value of term1 and term2.

  • term1=del_none, term2=del_x
C(I,J)=∫ΩNIβˆ‚NJβˆ‚xdΞ©C(I,J)=\int_{\Omega}N^{I}\frac{\partial N^{J}}{\partial x}d\Omega
  • term1=del_none, term2=del_y
C(I,J)=∫ΩNIβˆ‚NJβˆ‚ydΞ©C(I,J)=\int_{\Omega}N^{I}\frac{\partial N^{J}}{\partial y}d\Omega
  • term1=del_none, term2=del_z
C(I,J)=∫ΩNIβˆ‚NJβˆ‚zdΞ©C(I,J)=\int_{\Omega}N^{I}\frac{\partial N^{J}}{\partial z}d\Omega
  • term1=del_x, term2=del_none
C(I,J)=βˆ«Ξ©βˆ‚NIβˆ‚xNJdΞ©C(I,J)=\int_{\Omega}\frac{\partial N^{I}}{\partial x}N^{J}d\Omega
  • term1=del_y, term2=del_none
C(I,J)=βˆ«Ξ©βˆ‚NIβˆ‚yNJdΞ©C(I,J)=\int_{\Omega}\frac{\partial N^{I}}{\partial y}N^{J}d\Omega
  • term1=del_z, term2=del_none
C(I,J)=βˆ«Ξ©βˆ‚NIβˆ‚zNJdΞ©C(I,J)=\int_{\Omega}\frac{\partial N^{I}}{\partial z}N^{J}d\Omega
  • term1=del_none, term2=del_x_all opt=1
Ci1(I,J)=∫ΩNIβˆ‚NJβˆ‚xidΞ©C_{i1}(I,J)=\int_{\Omega}N^{I}\frac{\partial N^{J}}{\partial x_{i}}d\Omega
  • term1=del_none, term2=del_x_all opt=2
C1i(I,J)=∫ΩNIβˆ‚NJβˆ‚xidΞ©C_{1i}(I,J)=\int_{\Omega}N^{I}\frac{\partial N^{J}}{\partial x_{i}}d\Omega
  • term1=del_x_all, term2=del_none opt=1
Ci1(I,J)=βˆ«Ξ©βˆ‚NIβˆ‚xiNJdΞ©C_{i1}(I,J)=\int_{\Omega}\frac{\partial N^{I}}{\partial x_{i}}N^{J}d\Omega
  • term1=del_x_all, term2=del_none opt=2
C1i(I,J)=βˆ«Ξ©βˆ‚NIβˆ‚xiNJdΞ©C_{1i}(I,J)=\int_{\Omega}\frac{\partial N^{I}}{\partial x_{i}}N^{J}d\Omega

Convective Matrix 2​

Interface:

  MODULE PURE FUNCTION ConvectiveMatrix(test, trial, c, crank, term1, &
& term2, opt) RESULT(Ans)
CLASS(ElemshapeData_), INTENT(IN) :: test
CLASS(ElemshapeData_), INTENT(IN) :: trial
TYPE(FEVariable_), INTENT(IN) :: c
!! scalar variable
TYPE(FEVariableScalar_), INTENT(IN) :: crank
!! scalar variable
INTEGER(I4B), INTENT(IN) :: term1
!! del_x, del_y, del_z, del_x_all, del_none
INTEGER(I4B), INTENT(IN) :: term2
!! del_x, del_y, del_z, del_x_all, del_none
INTEGER( I4B ), OPTIONAL, INTENT( IN ) :: opt
!! number of copies
REAL(DFP), ALLOCATABLE :: ans(:, :)
END FUNCTION ConvectiveMatrix

!!! note "" Here cc is some scalar variable, it may be some constant, function of space coordinates given in terms of spatial nodal variable or quadrature variable

Following matrices can be computed by using this interface:

  • term1=del_none, term2=del_x
M(I,J)=∫ΩcNIβˆ‚NJβˆ‚xdΞ©M(I,J) = \int_{\Omega} c N^I \frac{\partial N^J}{\partial x} d{\Omega}
  • term1=del_none, term2=del_y
M(I,J)=∫ΩcNIβˆ‚NJβˆ‚ydΞ©M(I,J) = \int_{\Omega} c N^I \frac{\partial N^J}{\partial y} d{\Omega}
  • term1=del_none, term2=del_z
M(I,J)=∫ΩcNIβˆ‚NJβˆ‚zdΞ©M(I,J) = \int_{\Omega} c N^I \frac{\partial N^J}{\partial z} d{\Omega}
  • term1=del_none, term2=del_x_all opt=1
Ci1(I,J)=∫ΩρNIβˆ‚NJβˆ‚xidΞ©C_{i1}(I,J)=\int_{\Omega}\rho N^{I}\frac{\partial N^{J}}{\partial x_{i}}d\Omega
  • term1=del_none, term2=del_x_all opt=2
C1i(I,J)=∫ΩρNIβˆ‚NJβˆ‚xidΞ©C_{1i}(I,J)=\int_{\Omega}\rho N^{I}\frac{\partial N^{J}}{\partial x_{i}}d\Omega
  • term1=del_x, term2=del_none
M(I,J)=∫Ωcβˆ‚NIβˆ‚xNJdΞ©M(I,J) = \int_{\Omega} c \frac{\partial N^I}{\partial x} N^J d{\Omega}
  • term1=del_y, term2=del_none
M(I,J)=∫Ωcβˆ‚NIβˆ‚yNJdΞ©M(I,J) = \int_{\Omega} c \frac{\partial N^I}{\partial y} N^J d{\Omega}
  • term1=del_z, term2=del_none
M(I,J)=∫Ωcβˆ‚NIβˆ‚zNJdΞ©M(I,J) = \int_{\Omega} c \frac{\partial N^I}{\partial z} N^J d{\Omega}
  • term1=del_x_all, term2=del_none opt=1
Ci1(I,J)=βˆ«Ξ©Οβˆ‚NIβˆ‚xiNJdΞ©C_{i1}(I,J)=\int_{\Omega}\rho\frac{\partial N^{I}}{\partial x_{i}}N^{J}d\Omega
  • term1=del_x_all, term2=del_none opt=2
C1i(I,J)=βˆ«Ξ©Οβˆ‚NIβˆ‚xiNJdΞ©C_{1i}(I,J)=\int_{\Omega}\rho\frac{\partial N^{I}}{\partial x_{i}}N^{J}d\Omega

You can learn more from examples given below:

  • [[ConvectiveMatrix_test_21]] Line2 [[ReferenceLine_]]
  • [[ConvectiveMatrix_test_22]] Line2 [[ReferenceLine_]], c is nodal variable
  • [[ConvectiveMatrix_test_23]] Line2 [[ReferenceLine_]], c is quadrature variable
  • [[ConvectiveMatrix_test_24]] linear [[ReferenceTriangle_]]
  • [[ConvectiveMatrix_test_25]] high order [[ReferenceTriangle_]]
  • [[ConvectiveMatrix_test_26]] mixed FEM [[ReferenceTriangle_]]
  • [[ConvectiveMatrix_test_27]] linear [[ReferenceQuadrangle_]]
  • [[ConvectiveMatrix_test_28]] higher order [[ReferenceQuadrangle_]]
  • [[ConvectiveMatrix_test_29]] mixed FEM [[ReferenceQuadrangle_]]
  • [[ConvectiveMatrix_test_30]] linear [[ReferenceTetrahedron_]]
  • [[ConvectiveMatrix_test_31]] higher order [[ReferenceTetrahedron_]]
  • [[ConvectiveMatrix_test_32]] mixed FEM [[ReferenceTetrahedron_]]

ConvectiveMatrix 3​

Interface:

  MODULE PURE FUNCTION ConvectiveMatrix(test, trial, c, crank, term1, &
& term2, opt) RESULT(Ans)
CLASS(ElemshapeData_), INTENT(IN) :: test
CLASS(ElemshapeData_), INTENT(IN) :: trial
TYPE(FEVariable_), INTENT(IN) :: c
!! It can be a scalar or vector variable
TYPE(FEVariableVector_), INTENT(IN) :: crank
!! It can be a scalar or vector variable
INTEGER(I4B), INTENT(IN) :: term1
!! del_x, del_y, del_z, del_x_all, del_none
INTEGER(I4B), INTENT(IN) :: term2
!! del_x, del_y, del_z, del_x_all, del_none
INTEGER( I4B ), OPTIONAL, INTENT( IN ) :: opt
!! number of copies
REAL(DFP), ALLOCATABLE :: ans(:, :)
END FUNCTION ConvectiveMatrix

!!! note "Convective velocity" C(:,:) is a two dimensional array. It represents the spatial nodal values of convective velocity. The shape of C is (NSD, NNS). The first index of C denotes the spatial coordinates. The second index denotes the spatial nodal number. In this case, convective velocity varies in the space.

!!! note "Convective velocity" C(:) is a vector. It represents the spatial coordinates of convective velocity. The shape of C is (NSD). The first index of C denotes the spatial coordinates. In this case, convective velocity remains constant in the space.

Following matrices can be computed from this interface:

  • term1=del_none, term2=del_x
M(I,J)=∫ΩNIckβˆ‚NJβˆ‚xkdΞ©M(I,J) = \int_{\Omega} N^I c_k \frac{\partial N^J}{\partial x_k} d{\Omega}
  • term1=del_x, term2=del_none
M(I,J)=∫Ωckβˆ‚NIβˆ‚xkNJdΞ©M(I,J) = \int_{\Omega} c_k \frac{\partial N^I}{\partial x_k} N^J d{\Omega}

You can learn about this method from following pages

  • [[ConvectiveMatrix_test_1]] βš™ Line2 [[ReferenceLine_]] Constant velocity
  • [[ConvectiveMatrix_test_2]] βš™ Line2 [[ReferenceLine_]] Nodal values of velocity
  • [[ConvectiveMatrix_test_3]] βš™ Line2 [[ReferenceLine_]] Quadrature values of velocity
  • [[ConvectiveMatrix_test_4]] βš™ Line3 [[ReferenceLine_]] Nodal values of velocity
  • [[ConvectiveMatrix_test_5]] βš™ Line3 [[ReferenceLine_]] Quadrature values of velocity
  • [[ConvectiveMatrix_test_6]] βš™ mixed FEM for [[ReferenceLine_]]
  • [[ConvectiveMatrix_test_7]] βš™ for [[ReferenceTriangle_]]
  • [[ConvectiveMatrix_test_8]] βš™ for [[ReferenceTriangle_]] higher order
  • [[ConvectiveMatrix_test_9]] βš™ for [[ReferenceTriangle_]] mixed FEM
  • [[ConvectiveMatrix_test_10]] βš™ for [[ReferenceQuadrangle_]]
  • [[ConvectiveMatrix_test_11]] βš™ for [[ReferenceQuadrangle_]] for higher order
  • [[ConvectiveMatrix_test_12]] βš™ for [[ReferenceQuadrangle_]] for mixed FEM
  • [[ConvectiveMatrix_test_13]] βš™ for [[ReferenceTetrahedron_]]
  • [[ConvectiveMatrix_test_14]] βš™ for [[ReferenceTetrahedron_]] for higher order
  • [[ConvectiveMatrix_test_15]] βš™ for [[ReferenceTetrahedron_]] for mixed FEM

TODO​

Now consider the following terms in a PDE.

βˆ‚Uβˆ‚t+[A1]βˆ‚Uβˆ‚x+[A2]βˆ‚Uβˆ‚y+[A3]βˆ‚Uβˆ‚z+β‹―\frac{\partial \mathbf{U}}{\partial t} + [\mathbf{A_1}] \frac{\partial \mathbf{U} }{\partial x} + [\mathbf{A_2}] \frac{\partial \mathbf{U}}{\partial y} + [\mathbf{A_3}] \frac{\partial \mathbf{U}}{\partial z} + \cdots

where, U∈Rm\mathbf{U} \in R^m, and [Ai]∈R(mΓ—m)[\mathbf{A_i}] \in R^{(m\times m)}. For this we may need to compute the following matrices.

2M(I,J)=Ξ΄UiI∫ΩNI[A1]ijβˆ‚NJβˆ‚xdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} N^I [\mathbf{A_1}]_{ij} \frac{\partial N^J}{\partial x} d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[A1]jiβˆ‚NIβˆ‚xNJdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{A_1}]_{ji} \frac{\partial N^I}{\partial x} N^J d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫ΩNI[A2]ijβˆ‚NJβˆ‚ydΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} N^I [\mathbf{A_2}]_{ij} \frac{\partial N^J}{\partial y} d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[A2]jiβˆ‚NIβˆ‚yNJdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{A_2}]_{ji} \frac{\partial N^I}{\partial y} N^J d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫ΩNI[A3]ijβˆ‚NJβˆ‚zdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} N^I [\mathbf{A_3}]_{ij} \frac{\partial N^J}{\partial z} d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[A3]jiβˆ‚NIβˆ‚zNJdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{A_3}]_{ji} \frac{\partial N^I}{\partial z} N^J d{\Omega} \quad U_{jJ}
  • TODO Implement these methods.

We may want to compute following matrices

2M(I,J)=Ξ΄UiI∫Ω[B]kiNI[A1]kjβˆ‚NJβˆ‚xdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{B}]_{ki} N^I [\mathbf{A_1}]_{kj} \frac{\partial N^J}{\partial x} d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[A1]kiβˆ‚NIβˆ‚x[B]kjNJdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{A_1}]_{ki} \frac{\partial N^I}{\partial x} [\mathbf{B}]_{kj} N^J d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[B]kiNI[A2]kj[B]kjβˆ‚NJβˆ‚ydΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{B}]_{ki} N^I [\mathbf{A_2}]_{kj} [\mathbf{B}]_{kj} \frac{\partial N^J}{\partial y} d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[A2]kiβˆ‚NIβˆ‚yNJdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{A_2}]_{ki} \frac{\partial N^I}{\partial y} N^J d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[B]kiNI[A3]kjβˆ‚NJβˆ‚zdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{B}]_{ki} N^I [\mathbf{A_3}]_{kj} \frac{\partial N^J}{\partial z} d{\Omega} \quad U_{jJ} 2M(I,J)=Ξ΄UiI∫Ω[A3]kiβˆ‚NIβˆ‚z[B]kjNJdΞ©UjJ{}^{2}M(I,J) = \delta U_{iI} \int_{\Omega} [\mathbf{A_3}]_{ki} \frac{\partial N^I}{\partial z} [\mathbf{B}]_{kj} N^J d{\Omega} \quad U_{jJ}
  • TODO Implement these methods.

Examples​

| | | | | :------------------------------------------- | :------------------------------------------- | :------------------------------------------ | --- | | 🩱 Example 1 | πŸ‘¬ Example 2 | 🧡 Example 3 | | | πŸ€ Example 4 | πŸ•΅οΈβ€β™€οΈ Example 5 | πŸ”― Example 6 | | | πŸ™ˆ Example 7 | πŸ‹οΈ Example 8 | πŸ˜‡ Example 9 | | | β›Ί Example 10 | πŸ•΄οΈ Example 11 | |