Tag: MFEM
-
MFEM Tutorials (4) Simple Electomagnetic Diffusion Part C
Assemble the bilinear form and the corresponding linear system Assemble the bilinear form and the corresponding linear system, applying any necessary transformations such as: eliminating boundary conditions, applying conforming constraints for non-conforming AMR, static condensation, etc. This code first checks if the “static_cond” variable is true. If it is, it calls the EnableStaticCondensation method on…
-
MFEM Tutorials (4) Simple Electromagnetic Diffusion Part B
Read and refined the mesh from the given mesh file We can handle triangular, quadrilateral, tetrahedral, hexahedral, surface and volume meshes with the same code. Refine the mesh to increase the resolution. In this example we do ‘ref_levels’ of uniform refinement. We choose ‘ref_levels’ to be the/ largest number that gives a final mesh with…
-
MFEM Tutorials (3) Simple Linear Elasticity Problem Describing a Multi-Material Cantilever Beam Part B
Define a finite element space on the mesh. Here we use vector finite elements, i.e. dim copies of a scalar finite element space. The vector dimension is specified by the last argument of the FiniteElementSpace constructor. For NURBS meshes, we use the (degree elevated) NURBS space associated with the mesh nodes. This code sets up…
-
MFEM Tutorials (3) Simple Linear Elasticity Problem Describing a Multi-Material Cantilever Beam Part A
Description This example code solves a simple linear elasticity problem describing a multi-material cantilever beam. Specifically, we approximate the weak form of where is the stress tensor corresponding to displacement field $\textit{\textbf{u}}$, and lambda and mu // are the material Lame constants. The boundary conditions are $\textit{\textbf{u}}=0$ on the fixed part of the boundary with…
-
MFEM Tutorials (2) Simplest MFEM of Laplace Problem with Various Options Part B
Set up the bilinear form a(.,.) on the finite element space Set up the bilinear form a(.,.) on the finite element space corresponding to the Laplacian operator -Delta, by adding the Diffusion domain integrator. This code is the same as I explained earlier, it creates a BilinearForm object, “a”, which is used to represent the…
-
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…