-
Notifications
You must be signed in to change notification settings - Fork 46
Adding a new tutorial (Advection-Deffusion Equation) #187
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
41dc9b0
Update build.jl
yiyuef 362022e
Create 1
yiyuef d6e4256
Add files via upload
yiyuef bda0dca
Create gmsh_gridap.jl
yiyuef 76f7666
Update and rename gmsh_gridap.jl to advection_diffusion.jl
yiyuef 88a832c
Delete assets/gmsh_gridap directory
yiyuef a3ec2df
Create test.jl
yiyuef 8f3af0e
Add files via upload
yiyuef 049f5a6
Update Pentagon.geo
yiyuef e84d68d
Delete assets/advection_diffusion/test.jl
yiyuef bf8cfab
Add files via upload
yiyuef 8a2f5fb
Delete assets/advection_diffusion/pentagon_mesh.msh
yiyuef d11c600
Delete assets/advection_diffusion/Pentagon.geo
yiyuef 9de0b0c
Rename Pentagon.geo to pentagon.geo
yiyuef d59842b
Merge branch 'gridap:master' into master
yiyuef 9ad7733
Update build.jl
yiyuef 469293e
Update build.jl
yiyuef 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
// Gmsh project created on Wed Dec 4 14:27:19 2024 | ||
// ----------------------------------------------------------------------------- | ||
// | ||
// Gmsh GEO tutorial 1 | ||
// | ||
// Geometry basics, elementary entities, physical groups | ||
// | ||
// ----------------------------------------------------------------------------- | ||
|
||
// The simplest construction in Gmsh's scripting language is the | ||
// `affectation'. The following command defines a new variable `lc': | ||
|
||
lc = 1e-1; | ||
|
||
// This variable can then be used in the definition of Gmsh's simplest | ||
// `elementary entity', a `Point'. A Point is uniquely identified by a tag (a | ||
// strictly positive integer; here `1') and defined by a list of four numbers: | ||
// three coordinates (X, Y and Z) and the target mesh size (lc) close to the | ||
// point: | ||
|
||
|
||
|
||
// The distribution of the mesh element sizes will then be obtained by | ||
// interpolation of these mesh sizes throughout the geometry. Another method to | ||
// specify mesh sizes is to use general mesh size Fields (see `t10.geo'). A | ||
// particular case is the use of a background mesh (see `t7.geo'). | ||
|
||
// If no target mesh size of provided, a default uniform coarse size will be | ||
// used for the model, based on the overall model size. | ||
|
||
// We can then define some additional points. All points should have different | ||
// tags: | ||
|
||
Point(1) = {0, -1.0000, 0, lc}; | ||
Point(2) = {0, 1.0000, 0, lc}; | ||
Point(3) = {1.9015, 1.6190, 0, lc}; | ||
Point(4) = {3.0777, 0, 0, lc}; | ||
Point(5) = {1.9015, -1.6190, 0, lc}; | ||
|
||
// Point(1) = {0.8507, 0, 0, lc}; | ||
// Point(2) = {0.2629, 0.8090, 0, lc}; | ||
// Point(3) = {-0.6882, 0.5000, 0, lc}; | ||
// Point(4) = {-0.6882, -0.5000, 0, lc}; | ||
// Point(5) = {0.2629, -0.8090, 0, lc}; | ||
|
||
// Curves are Gmsh's second type of elementary entities, and, amongst curves, | ||
// straight lines are the simplest. A straight line is identified by a tag and | ||
// is defined by a list of two point tags. In the commands below, for example, | ||
// the line 1 starts at point 1 and ends at point 2. | ||
// | ||
// Note that curve tags are separate from point tags - hence we can reuse tag | ||
// `1' for our first curve. And as a general rule, elementary entity tags in | ||
// Gmsh have to be unique per geometrical dimension. | ||
|
||
Line(1) = {1, 2}; | ||
Line(2) = {2, 3}; | ||
Line(3) = {3, 4}; | ||
Line(4) = {4, 5}; | ||
Line(5) = {5, 1}; | ||
|
||
// The third elementary entity is the surface. In order to define a simple | ||
// rectangular surface from the four curves defined above, a curve loop has | ||
// first to be defined. A curve loop is also identified by a tag (unique amongst | ||
// curve loops) and defined by an ordered list of connected curves, a sign being | ||
// associated with each curve (depending on the orientation of the curve to form | ||
// a loop): | ||
|
||
Curve Loop(1) = {1, 2, 3, 4, 5}; | ||
|
||
// We can then define the surface as a list of curve loops (only one here, | ||
// representing the external contour, since there are no holes--see `t4.geo' for | ||
// an example of a surface with a hole): | ||
|
||
Plane Surface(1) = {1}; | ||
|
||
// At this level, Gmsh knows everything to display the rectangular surface 1 and | ||
// to mesh it. An optional step is needed if we want to group elementary | ||
// geometrical entities into more meaningful groups, e.g. to define some | ||
// mathematical ("domain", "boundary"), functional ("left wing", "fuselage") or | ||
// material ("steel", "carbon") properties. | ||
// | ||
// Such groups are called "Physical Groups" in Gmsh. By default, if physical | ||
// groups are defined, Gmsh will export in output files only mesh elements that | ||
// belong to at least one physical group. (To force Gmsh to save all elements, | ||
// whether they belong to physical groups or not, set `Mesh.SaveAll=1;', or | ||
// specify `-save_all' on the command line.) Physical groups are also identified | ||
// by tags, i.e. strictly positive integers, that should be unique per dimension | ||
// (0D, 1D, 2D or 3D). Physical groups can also be given names. | ||
// | ||
// Here we define a physical curve that groups the left, bottom and right curves | ||
// in a single group (with prescribed tag 5); and a physical surface with name | ||
// "My surface" (with an automatic tag) containing the geometrical surface 1: | ||
|
||
Physical Line("l1") = {1}; | ||
Physical Line("l2") = {2}; | ||
Physical Line("l3") = {3}; | ||
Physical Line("l4") = {4}; | ||
Physical Line("l5") = {5}; | ||
|
||
Physical Curve(“b1”) = {1, 2, 4}; | ||
Physical Curve("b2") = {3}; | ||
|
||
Physical Surface("My surface") = {1}; | ||
|
||
// Now that the geometry is complete, you can | ||
// - either open this file with Gmsh and select `2D' in the `Mesh' module to | ||
// create a mesh; then select `Save' to save it to disk in the default format | ||
// (or use `File->Export' to export in other formats); | ||
// - or run `gmsh t1.geo -2` to mesh in batch mode on the command line. | ||
|
||
// You could also uncomment the following lines in this script: | ||
// | ||
Mesh 2; | ||
Save "pentagon_mesh.msh"; | ||
// | ||
// which would lead Gmsh to mesh and save the mesh every time the file is | ||
// parsed. (To simply parse the file from the command line, you can use `gmsh | ||
// t1.geo -') | ||
|
||
// By default, Gmsh saves meshes in the latest version of the Gmsh mesh file | ||
// format (the `MSH' format). You can save meshes in other mesh formats by | ||
// specifying a filename with a different extension in the GUI, on the command | ||
// line or in scripts. For example | ||
// | ||
// Save "t1.unv"; | ||
// | ||
// will save the mesh in the UNV format. You can also save the mesh in older | ||
// versions of the MSH format: | ||
// | ||
// - In the GUI: open `File->Export', enter your `filename.msh' and then pick | ||
// the version in the dropdown menu. | ||
// - On the command line: use the `-format' option (e.g. `gmsh file.geo -format | ||
// msh2 -2'). | ||
// - In a `.geo' script: add `Mesh.MshFileVersion = x.y;' for any version | ||
// number `x.y'. | ||
// - As an alternative method, you can also not specify the format explicitly, | ||
// and just choose a filename with the `.msh2' or `.msh4' extension. | ||
|
||
// Note that starting with Gmsh 3.0, models can be built using other geometry | ||
// kernels than the default built-in kernel. By specifying | ||
// | ||
// SetFactory("OpenCASCADE"); | ||
// | ||
// any subsequent command in the `.geo' file would be handled by the OpenCASCADE | ||
// geometry kernel instead of the built-in kernel. Different geometry kernels | ||
// have different features. With OpenCASCADE, instead of defining the surface by | ||
// successively defining 4 points, 4 curves and 1 curve loop, one can define the | ||
// rectangular surface directly with | ||
// | ||
// Rectangle(2) = {.2, 0, 0, .1, .3}; | ||
// | ||
// The underlying curves and points could be accessed with the `Boundary' or | ||
// `CombinedBoundary' operators. | ||
// | ||
// See e.g. `t16.geo', `t18.geo', `t19.geo' or `t20.geo' for complete examples | ||
// based on OpenCASCADE, and `examples/boolean' for more. |
Oops, something went wrong.
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.
Missing a coma
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.
my mistake! done.