Category: C++
-
MFEM Tutorials (1) Simplest MFEM of Laplace Problem
Description This example code demonstrates the most basic usage of MFEM to define a simple finite element discretization of the Laplace problem with zero Dirichlet boundary conditions. General 2D/3D mesh files and finite element polynomial degrees can be specified by command line options. Parse command line options This code includes the header files for the…
-
NGSolve Example for Heat Transfer using Complex Geometries Part B
These lines of code are using the Mesh class from the ngsolve module to create a finite element mesh of the 3D model of the package. The Mesh class is used to create a discretization of the 3D model that can be used to perform finite element analysis (FEA). The OCCGeometry class from the netgen.occ…
-
Boolean Operation Examples for Netgen
In computer-aided design (CAD), boolean operations are a set of functions that allow you to create new shapes by combining or modifying existing shapes. These operations are called boolean because they are based on the logical values of true and false, and they use the concepts of union, intersection, and difference to create new shapes.…
-
Practice Eigen3 (1) Solving Cantiliver Beam Deflection Problems with Multifrontal Solver
To solve the cantilever beam deflection problem using the multifrontal solver in Eigen, you can follow these steps: Here is an example of how you can implement these steps in Eigen: To assemble the global stiffness matrix K for a one-dimensional beam using the finite element method, you can follow these steps: where E is…
-
Inverse Matrix Features for Eigen3 -(2) Multifrontal Solvers and Parallization using OpenMP
You can use the multifrontal solver in Eigen to solve linear systems of equations involving dense matrices. The multifrontal solver is a direct solver that uses the multifrontal method to factorize the coefficient matrix and solve the linear system. Here is an example of how you can use the multifrontal solver in Eigen: You can…
-
Inverse Matrix Features for Eigen3 -(1) Inverse for Dense and Sparse Matrix
To compute the inverse of a matrix using Eigen, you can use the inverse() function, which is defined for both dense and sparse matrices. Here are a few examples:
-
Sparse Matrix Tutorials for Eigen3
Eigen provides the SparseMatrix class for representing sparse matrices, which are matrices that have a significant number of zero elements. Here are a few examples of how you can use the SparseMatrix class in Eigen: Eigen provides many functions for performing operations on sparse matrices, such as matrix-vector multiplication and matrix-matrix multiplication. Here are some…
-
How to do Coordinate Transformation for points on three dimensional space using Eigen3
Eigen provides several tools for performing coordinate transformations on points in three-dimensional space. Here are a few examples of how you can use Eigen to transform points: To translate a point by a fixed vector, you can use the translation function to create a translation matrix, and then multiply the point by this matrix: To…
-
4th Order Tensor Operation by Eigen3
A tensor is a multi-dimensional array, and in Eigen, the Tensor class can be used to represent a tensor of any rank (number of dimensions). Here are some examples of operations on a 4th-order tensor (tensor of rank 4) in Eigen: 1. Creating a 4th-order tensor: 2. Accessing elements of a 4th-order tensor: 3. Performing…
-
Matrix Operations for Eigen3
Here are some examples of matrix operations in Eigen: 1. Summation 2. Subtraction: 3. Inner product: 4. Cross product: #Eigen3 #InnerProduct #CrossProduct #Summation of Matrix #Substration of Matrix