-
Notifications
You must be signed in to change notification settings - Fork 6
Fixes to Integration #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Joshua-Kloepfer
wants to merge
10
commits into
main
Choose a base branch
from
jk/FixIntegration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1954606
Added integration test, added functionality for quadratic mesh Jacobi…
6929222
Reverted change to mappings. Finished test and second order integration
eb15d22
Adding documentation on node ordering for integration
Joshua-Kloepfer aa78d19
removed descriptions
Joshua-Kloepfer 6a64095
fixed messed up whitespace
Joshua-Kloepfer de7f7d9
adding an integration test with omegah box
Joshua-Kloepfer 6236e1c
Merge branch 'jk/FixIntegration' of github.com:SCOREC/meshFields into…
Joshua-Kloepfer ee3b159
Adding mfem test for integration
Joshua-Kloepfer 77a4abf
Add mfem test info
Joshua-Kloepfer cafc193
Adding more build info
Joshua-Kloepfer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| \documentclass{article} | ||
| \usepackage{graphicx} | ||
| \usepackage[letterpaper,textwidth=5in,right=2.5in,textheight=9in]{geometry} | ||
|
|
||
| \usepackage{amsmath,amssymb, changepage} | ||
| \usepackage{enumerate} | ||
| \usepackage{upgreek} | ||
| \pagestyle{empty} | ||
| \usepackage{listings} | ||
| \usepackage{tikz} | ||
| \begin{document} | ||
| \noindent | ||
| Joshua Kloepfer\\ | ||
| 9/30/2025\\ | ||
| \textbf{Meshfields DOF Holder and Integration Point Ordering}\\\\ | ||
| Linear Triangle:\\ | ||
| \begin{tikzpicture} | ||
| \draw[gray, thick] (0, 0) -- (2.5, 2.5); | ||
| \draw[gray, thick] (0, 0) -- (5, 0); | ||
| \draw[gray, thick] (2.5, 2.5) -- (5, 0); | ||
| \filldraw[black] (0, 0) circle (2pt) node[anchor=east]{V0}; | ||
| \filldraw[black] (5, 0) circle (2pt) node[anchor=west]{V1}; | ||
| \filldraw[black] (2.5, 2.5) circle (2pt) node[anchor=south]{V2}; | ||
| \end{tikzpicture} | ||
| \\ | ||
| Quadratic Triangle\\ | ||
| \begin{tikzpicture} | ||
| \draw[gray, thick] (0, 0) -- (2.5, 2.5); | ||
| \draw[gray, thick] (0, 0) -- (5, 0); | ||
| \draw[gray, thick] (2.5, 2.5) -- (5, 0); | ||
| \filldraw[black] (0, 0) circle (2pt) node[anchor=east]{V0}; | ||
| \filldraw[black] (5, 0) circle (2pt) node[anchor=west]{V1}; | ||
| \filldraw[black] (2.5, 2.5) circle (2pt) node[anchor=south]{V2}; | ||
| \filldraw[black] (2.5, 0) circle (2pt) node[anchor=north]{E0}; | ||
| \filldraw[black] (3.75, 1.25) circle (2pt) node[anchor=west]{E1}; | ||
| \filldraw[black] (1.25, 1.25) circle (2pt) node[anchor=east]{E2}; | ||
| \end{tikzpicture} | ||
| \\ | ||
| Linear Tetrahedron:\\ | ||
| \begin{tikzpicture} | ||
| \draw[gray, thick] (0, 0, 0) -- (5, 0, 0); | ||
| \draw[gray, thick] (0, 0, 0) -- (0, 5, 0); | ||
| \draw[gray, thick] (5, 0, 0) -- (0, 5, 0); | ||
| \draw[gray, thick] (0, 0, 0) -- (0, 0, 5); | ||
| \draw[gray, thick] (5, 0, 0) -- (0, 0, 5); | ||
| \draw[gray, thick] (0, 5, 0) -- (0, 0, 5); | ||
| \filldraw[black] (0, 0, 5) circle (2pt) node[anchor=east]{V0}; | ||
| \filldraw[black] (5, 0, 0) circle (2pt) node[anchor=west]{V1}; | ||
| \filldraw[black] (0, 0, 0) circle (2pt) node[anchor=east]{V2}; | ||
| \filldraw[black] (0, 5, 0) circle (2pt) node[anchor=south]{V3}; | ||
| \end{tikzpicture} | ||
| \\ | ||
| Vertex ordering must follow right hand rule.\\ | ||
| Quadratic Tetrahedron:\\ | ||
| \begin{tikzpicture} | ||
| \draw[gray, thick] (0, 0, 0) -- (5, 0, 0); | ||
| \draw[gray, thick] (0, 0, 0) -- (0, 5, 0); | ||
| \draw[gray, thick] (5, 0, 0) -- (0, 5, 0); | ||
| \draw[gray, thick] (0, 0, 0) -- (0, 0, 5); | ||
| \draw[gray, thick] (5, 0, 0) -- (0, 0, 5); | ||
| \draw[gray, thick] (0, 5, 0) -- (0, 0, 5); | ||
| \filldraw[black] (0, 0, 5) circle (2pt) node[anchor=east]{V0}; | ||
| \filldraw[black] (5, 0, 0) circle (2pt) node[anchor=west]{V1}; | ||
| \filldraw[black] (0, 0, 0) circle (2pt) node[anchor=east]{V2}; | ||
| \filldraw[black] (0, 5, 0) circle (2pt) node[anchor=south]{V3}; | ||
|
|
||
| \filldraw[black] (2.5, 0, 2.5) circle (2pt) node[anchor=north]{E0}; | ||
| \filldraw[black] (0, 0, 2.5) circle (2pt) node[anchor=east]{E1}; | ||
| \filldraw[black] (0, 2.5, 2.5) circle (2pt) node[anchor=east]{E2}; | ||
| \filldraw[black] (2.5, 0, 0) circle (2pt) node[anchor=south]{E3}; | ||
| \filldraw[black] (2.5, 2.5, 0) circle (2pt) node[anchor=east]{E4}; | ||
| \filldraw[black] (0, 2.5, 0) circle (2pt) node[anchor=west]{E5}; | ||
| \end{tikzpicture} | ||
| \\ | ||
| Vertex ordering must follow right hand rule and edge ordering must follow diagram. | ||
| \end{document} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #include "mfem.hpp" | ||
| #include <fstream> | ||
| #include <iostream> | ||
|
|
||
| using namespace std; | ||
| using namespace mfem; | ||
|
|
||
| double intFunc(const Vector &x) { | ||
| return x[0]; | ||
| } | ||
|
|
||
| int main(int argc, char *argv[]) { | ||
| Mesh mesh = Mesh::MakeCartesian3D(100, 100, 100, Element::TETRAHEDRON, 100, 100, 100, false); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should set the first three args from the command line so we can run a scaling test without having to recompile. |
||
| //6 million element mesh | ||
| H1_FECollection fec(1, mesh.Dimension()); | ||
| FiniteElementSpace fespace(&mesh, &fec); | ||
|
|
||
| FunctionCoefficient custom(intFunc); | ||
|
|
||
| LinearForm b(&fespace); | ||
|
|
||
| b.AddDomainIntegrator(new DomainLFIntegrator(custom)); | ||
|
|
||
| b.Assemble(); | ||
| cout << b.Sum() << endl; | ||
| return 0; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #include "mfem.hpp" | ||
| #include <fstream> | ||
| #include <iostream> | ||
|
|
||
| using namespace std; | ||
| using namespace mfem; | ||
|
|
||
| double intFunc(const Vector &x) { | ||
| return x[0]; | ||
| } | ||
|
|
||
| int main(int argc, char *argv[]) | ||
| { | ||
| // 1. Parse command line options. | ||
| string mesh_file = "../data/star.mesh"; | ||
| int order = 1; | ||
|
|
||
| OptionsParser args(argc, argv); | ||
| args.AddOption(&mesh_file, "-m", "--mesh", "Mesh file to use."); | ||
| args.AddOption(&order, "-o", "--order", "Finite element polynomial degree"); | ||
| args.ParseCheck(); | ||
| Mesh mesh(mesh_file); | ||
|
|
||
| H1_FECollection fec(order, mesh.Dimension()); | ||
| FiniteElementSpace fespace(&mesh, &fec); | ||
|
|
||
| FunctionCoefficient custom(intFunc); | ||
|
|
||
| LinearForm b(&fespace); | ||
|
|
||
| b.AddDomainIntegrator(new DomainLFIntegrator(custom)); | ||
|
|
||
| b.Assemble(); | ||
|
|
||
| cout << b.Sum() << endl; | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Run using g++ IntegratorMfemTest.cpp -I<path-to-mfem-build> -L<path-to-mfem-build> -l mfem | ||
cwsmith marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| in order to run, use -m to specify the mesh file and -o to specify order | ||
| mfem version: https://github.com/mfem/mfem/tree/2caa75e35a54df93d19f23655170254556dfc081 | ||
| For the build: | ||
| mkdir <mfem-build-dir> ; cd <mfem-build-dir> | ||
| cmake <mfem-source-dir> | ||
| make -j 4 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| MFEM mesh v1.0 | ||
|
|
||
| # | ||
| # MFEM Geometry Types (see fem/geom.hpp): | ||
| # | ||
| # POINT = 0 | ||
| # SEGMENT = 1 | ||
| # TRIANGLE = 2 | ||
| # SQUARE = 3 | ||
| # TETRAHEDRON = 4 | ||
| # CUBE = 5 | ||
| # PRISM = 6 | ||
| # PYRAMID = 7 | ||
| # | ||
|
|
||
| dimension | ||
| 3 | ||
|
|
||
| elements | ||
| 6 | ||
| 1 4 7 0 3 1 | ||
| 1 4 7 0 1 5 | ||
| 1 4 7 0 5 4 | ||
| 1 4 7 0 2 3 | ||
| 1 4 7 0 6 2 | ||
| 1 4 7 0 4 6 | ||
|
|
||
| boundary | ||
| 12 | ||
| 1 2 3 0 2 | ||
| 1 2 0 3 1 | ||
| 6 2 7 4 5 | ||
| 6 2 4 7 6 | ||
| 5 2 6 0 4 | ||
| 5 2 0 6 2 | ||
| 3 2 7 1 3 | ||
| 3 2 1 7 5 | ||
| 2 2 5 0 1 | ||
| 2 2 0 5 4 | ||
| 4 2 7 2 6 | ||
| 4 2 2 7 3 | ||
|
|
||
| vertices | ||
| 8 | ||
| 3 | ||
| 0 0 0 | ||
| 1 0 0 | ||
| 0 1 0 | ||
| 1 1 0 | ||
| 0 0 1 | ||
| 1 0 1 | ||
| 0 1 1 | ||
| 1 1 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| MFEM mesh v1.0 | ||
|
|
||
| # | ||
| # MFEM Geometry Types (see fem/geom.hpp): | ||
| # | ||
| # POINT = 0 | ||
| # SEGMENT = 1 | ||
| # TRIANGLE = 2 | ||
| # SQUARE = 3 | ||
| # TETRAHEDRON = 4 | ||
| # CUBE = 5 | ||
| # PRISM = 6 | ||
| # | ||
|
|
||
| dimension | ||
| 2 | ||
|
|
||
| elements | ||
| 2 | ||
| 1 2 0 1 3 | ||
| 1 2 2 3 1 | ||
|
|
||
| boundary | ||
| 4 | ||
| 1 1 0 1 | ||
| 2 1 1 2 | ||
| 3 1 2 3 | ||
| 4 1 3 0 | ||
|
|
||
| vertices | ||
| 4 | ||
| 2 | ||
| 0 0 | ||
| 1 0 | ||
| 1 1 | ||
| 0 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this comment/text.