
MFEM은 무엇인가?
MFEM 은 유한 요소 방법을 사용하여 편미분 방정식 을 해결하기위한 오픈 소스 C ++ 라이브러리 로, Lawrence Livermore National Laboratory의 연구원 과 GitHub 의 MFEM 오픈 소스 커뮤니티에서
개발 및 유지 관리합니다 . MFEM은 BSD 라이선스에 따라 출시 된 무료 소프트웨어 입니다.
라이브러리는 유체 역학 ,구조 역학 ,전자기학 ,복사 전달 등의 문제에 적용 할 수있는
유한 요소 솔버를 개발하기위한 빌딩 블록 역할을하는 C ++ 클래스로 구성됩니다.
왜 나는 설치하였는가?

dealii는 지나치게 클래스 지향적인 반면에
그래도 MFEM은 코드가 직관적이다.
dealii를 사용하겠지만 같이 보면 좋을것 같아서 (교수님 조언...)
설치하게 되었습니다.


설치하기
MFEM - Finite Element Discretization Library
mfem.org


make serial -j 4


Example 실행하기

cd examples
make

step 1번을 실행해보도록 합시다.
./ex1 -m ../data/star.mesh
방식이 특이한데 mesh 인풋 파일을 넣어줘야 한다.
dealii랑은 좀 다르다.


결과값은 아래 접은글
Iteration : 0 (B r, r) = 0.00113865
Iteration : 1 (B r, r) = 0.00700883
Iteration : 2 (B r, r) = 0.0123246
Iteration : 3 (B r, r) = 0.0126492
Iteration : 4 (B r, r) = 0.0123827
Iteration : 5 (B r, r) = 0.0114413
Iteration : 6 (B r, r) = 0.0105115
Iteration : 7 (B r, r) = 0.0094544
Iteration : 8 (B r, r) = 0.00872115
Iteration : 9 (B r, r) = 0.00802088
Iteration : 10 (B r, r) = 0.00740144
Iteration : 11 (B r, r) = 0.00671613
Iteration : 12 (B r, r) = 0.00616669
Iteration : 13 (B r, r) = 0.00570699
Iteration : 14 (B r, r) = 0.00526077
Iteration : 15 (B r, r) = 0.00478014
Iteration : 16 (B r, r) = 0.00425221
Iteration : 17 (B r, r) = 0.00382806
Iteration : 18 (B r, r) = 0.00341029
Iteration : 19 (B r, r) = 0.00303858
Iteration : 20 (B r, r) = 0.00262622
Iteration : 21 (B r, r) = 0.00220785
Iteration : 22 (B r, r) = 0.00185973
Iteration : 23 (B r, r) = 0.00155961
Iteration : 24 (B r, r) = 0.00132482
Iteration : 25 (B r, r) = 0.00108592
Iteration : 26 (B r, r) = 0.000858139
Iteration : 27 (B r, r) = 0.000643577
Iteration : 28 (B r, r) = 0.000484502
Iteration : 29 (B r, r) = 0.000347493
Iteration : 30 (B r, r) = 0.000239521
Iteration : 31 (B r, r) = 0.000148426
Iteration : 32 (B r, r) = 9.8493e-05
Iteration : 33 (B r, r) = 0.000100685
Iteration : 34 (B r, r) = 0.000148852
Iteration : 35 (B r, r) = 8.92621e-05
Iteration : 36 (B r, r) = 4.11046e-05
Iteration : 37 (B r, r) = 3.84869e-05
Iteration : 38 (B r, r) = 1.82937e-05
Iteration : 39 (B r, r) = 1.55218e-05
Iteration : 40 (B r, r) = 7.4462e-06
Iteration : 41 (B r, r) = 4.90733e-06
Iteration : 42 (B r, r) = 2.33751e-06
Iteration : 43 (B r, r) = 1.24252e-06
Iteration : 44 (B r, r) = 6.66791e-07
Iteration : 45 (B r, r) = 3.37966e-07
Iteration : 46 (B r, r) = 2.40738e-07
Iteration : 47 (B r, r) = 1.50505e-07
Iteration : 48 (B r, r) = 9.18797e-08
Iteration : 49 (B r, r) = 6.97035e-08
Iteration : 50 (B r, r) = 5.37315e-08
Iteration : 51 (B r, r) = 4.17658e-08
Iteration : 52 (B r, r) = 3.11531e-08
Iteration : 53 (B r, r) = 1.64606e-08
Iteration : 54 (B r, r) = 9.07227e-09
Iteration : 55 (B r, r) = 6.24371e-09
Iteration : 56 (B r, r) = 3.38912e-09
Iteration : 57 (B r, r) = 1.62225e-09
Iteration : 58 (B r, r) = 9.4649e-10
Iteration : 59 (B r, r) = 5.01049e-10
Iteration : 60 (B r, r) = 3.04051e-10
Iteration : 61 (B r, r) = 2.10839e-10
Iteration : 62 (B r, r) = 1.65681e-10
Iteration : 63 (B r, r) = 1.58687e-10
Iteration : 64 (B r, r) = 1.56262e-10
Iteration : 65 (B r, r) = 1.6096e-10
Iteration : 66 (B r, r) = 1.59923e-10
Iteration : 67 (B r, r) = 1.37372e-10
Iteration : 68 (B r, r) = 1.63878e-10
Iteration : 69 (B r, r) = 2.18571e-10
Iteration : 70 (B r, r) = 2.13489e-10
Iteration : 71 (B r, r) = 1.97445e-10
Iteration : 72 (B r, r) = 2.07485e-10
Iteration : 73 (B r, r) = 1.33731e-10
Iteration : 74 (B r, r) = 7.87996e-11
Iteration : 75 (B r, r) = 3.52365e-11
Iteration : 76 (B r, r) = 1.51062e-11
Iteration : 77 (B r, r) = 5.8275e-12
Iteration : 78 (B r, r) = 3.64938e-12
Iteration : 79 (B r, r) = 2.71871e-12
Iteration : 80 (B r, r) = 2.50711e-12
Iteration : 81 (B r, r) = 1.75076e-12
Iteration : 82 (B r, r) = 1.53084e-12
Iteration : 83 (B r, r) = 1.50804e-12
Iteration : 84 (B r, r) = 1.46477e-12
Iteration : 85 (B r, r) = 1.33758e-12
Iteration : 86 (B r, r) = 1.16445e-12
Iteration : 87 (B r, r) = 8.64825e-13
Iteration : 88 (B r, r) = 6.31342e-13
Iteration : 89 (B r, r) = 4.66187e-13
Iteration : 90 (B r, r) = 2.48911e-13
Iteration : 91 (B r, r) = 1.26588e-13
Iteration : 92 (B r, r) = 6.14599e-14
Iteration : 93 (B r, r) = 3.19709e-14
Iteration : 94 (B r, r) = 2.74487e-14
Iteration : 95 (B r, r) = 2.88388e-14
Iteration : 96 (B r, r) = 3.27275e-14
Iteration : 97 (B r, r) = 2.77879e-14
Iteration : 98 (B r, r) = 2.38204e-14
Iteration : 99 (B r, r) = 2.56744e-14
Iteration : 100 (B r, r) = 1.99585e-14
Iteration : 101 (B r, r) = 1.12294e-14
Iteration : 102 (B r, r) = 6.93925e-15
Iteration : 103 (B r, r) = 4.7605e-15
Iteration : 104 (B r, r) = 2.8727e-15
Iteration : 105 (B r, r) = 2.82701e-15
Iteration : 106 (B r, r) = 3.53178e-15
Iteration : 107 (B r, r) = 3.68339e-15
Iteration : 108 (B r, r) = 3.89124e-15
Iteration : 109 (B r, r) = 2.55846e-15
Iteration : 110 (B r, r) = 1.76748e-15
Iteration : 111 (B r, r) = 1.10523e-15
GLVis server를 사용한다면?


glvis설치하기

GLVis - OpenGL Finite Element Visualization Tool
Building GLVis A simple tutorial how to build and run GLVis together with MFEM. For more details, see the INSTALL file. Dependencies Starting with version 4.0, GLVis requires the following dependencies in order to build and run: SDL2, GLEW, GLM, Freetype,
glvis.org

GLVis를 설치하기 위해서는 위와 같은 라이브러리가 필요하다.
apt-get install libfontconfig1-dev libfreetype-dev libsdl2-dev libglew-dev libglm-dev libpng-dev

왜 우분투로 진행했을까
centOs는 일일히 라이브러를 설치해줘야 하므로
우분투에 MFEM을 설치하기로 했다.
(CentOs는 이런점이 불편하다. 빠르긴 하지만..)

mfem도 설치하도록 한다.
make serial -j 4



make MFEM_DIR=/home/kim/바탕화면/mfem/mfem-4.2 -j

설치완료!
실행하기

이상태에사 example 1코드를 실행보도록 하자.


성공!!
'수치해석' 카테고리의 다른 글
[Linux]MLpack install (0) | 2021.05.21 |
---|