From 4a306714c00e0c9048def60c6583925ff3aae632 Mon Sep 17 00:00:00 2001 From: Vikas Sharma Date: Tue, 26 Mar 2024 18:50:20 +0900 Subject: [PATCH] Adding more docs --- .dockerignore | 158 ++++++++++++++ .github/workflows/deploy.yml | 92 ++++---- .github/workflows/test-deploy.yml | 50 ++--- Dockerfile | 45 ++++ .../Domain/examples/_ExportMesh_test_1.md | 31 +++ .../Domain/examples/_GetBoundingBox_test_1.md | 27 +++ .../examples/_GetNodeToElements_test_1.md | 75 +++++++ .../examples/_GetTotalElements_test_1.md | 53 +++++ .../Domain/examples/_GetTotalNodes_test_1.md | 53 +++++ .../Domain/examples/_Initiate_test_1.md | 21 ++ .../Domain/examples/_IsNodePresent_test_1.md | 31 +++ .../examples/_SetMeshFacetElement_test_1.md | 25 +++ .../Domain/examples/_SetMeshMap_test_1.md | 29 +++ .../Domain/examples/_SetSparsity_test_1.md | 64 ++++++ .../Domain/examples/_maxNptrs_test_1.md | 33 +++ docs/docs-api/EdgeData/examples/_test_1.md | 34 +-- docs/docs-api/EdgeData/examples/_test_2.md | 31 +-- docs/docs-api/EdgeData/examples/_test_3.md | 35 +-- docs/docs-api/EdgeData/examples/_test_4.md | 35 +-- docs/docs-api/FEMesh/FEMesh_.md | 6 + .../_DisplayBoundaryFacetData_test_1.md | 30 +++ .../_DisplayBoundaryFacetData_test_2.md | 27 +++ .../examples/_DisplayElementData_test_1.md | 35 +++ .../_DisplayInternalFacetData_test_1.md | 25 +++ .../examples/_DisplayNodeData_test_1.md | 24 ++ .../FEMesh/examples/_FacetElement_test_1.md | 73 +++++++ .../FEMesh/examples/_FacetElement_test_2.md | 78 +++++++ .../FEMesh/examples/_FacetElement_test_3.md | 57 +++++ .../FEMesh/examples/_FacetElement_test_4.md | 70 ++++++ .../FEMesh/examples/_FacetElement_test_5.md | 71 ++++++ .../FEMesh/examples/_FacetElement_test_6.md | 77 +++++++ .../FEMesh/examples/_FacetElement_test_7.md | 88 ++++++++ .../_GetBoundaryElementData_test_1.md | 37 ++++ .../FEMesh/examples/_GetBoundingBox_test_2.md | 49 +++++ .../FEMesh/examples/_GetBounding_test_1.md | 33 +++ .../examples/_GetElementToElements_test_1.md | 57 +++++ .../examples/_GetElementToElements_test_2.md | 31 +++ .../FEMesh/examples/_GetMaxNNE_test_1.md | 30 +++ .../FEMesh/examples/_GetMaxNNE_test_2.md | 26 +++ .../FEMesh/examples/_GetNNE_test_1.md | 29 +++ .../FEMesh/examples/_GetNNE_test_2.md | 26 +++ .../examples/_GetNodeConnectivity_test_1.md | 25 +++ .../examples/_GetNodeToElements_test_1.md | 52 +++++ .../examples/_GetNodeToElements_test_2.md | 52 +++++ .../FEMesh/examples/_GetNodeToNodes_test_1.md | 64 ++++++ .../FEMesh/examples/_GetNodeToNodes_test_2.md | 68 ++++++ .../examples/_GetNodeToNodes_test_20.md | 39 ++++ .../examples/_GetNodeToNodes_test_30.md | 47 ++++ .../_InitiateEdgeConnectivity_test_1.md | 34 +++ .../FEMesh/examples/_InitiateElemSD_test_1.md | 30 +++ .../FEMesh/examples/_InitiateElemSD_test_2.md | 30 +++ .../_InitiateElementToElements_test_1.md | 34 +++ .../_InitiateFaceConnectivity_test_1.md | 38 ++++ .../_InitiateFaceConnectivity_test_2.md | 43 ++++ .../examples/_InitiateFacetElemSD_test_1.md | 42 ++++ .../_InitiateNodeToElements_test_1.md | 29 +++ .../_InitiateNodeToElements_test_2.md | 27 +++ .../_InitiateNodeToElements_test_3.md | 27 +++ .../_InitiateNodeToElements_test_4.md | 29 +++ .../examples/_InitiateNodeToNodes_test_1.md | 29 +++ .../examples/_InitiateNodeToNodes_test_2.md | 27 +++ .../examples/_InitiateNodeToNodes_test_3.md | 28 +++ .../FEMesh/examples/_Initiate_test_1.md | 49 +++++ .../FEMesh/examples/_Initiate_test_2.md | 49 +++++ .../FEMesh/examples/_Initiate_test_3.md | 49 +++++ .../FEMesh/examples/_Initiate_test_4.md | 49 +++++ .../FEMesh/examples/_Initiate_test_5.md | 49 +++++ docs/docs-api/FEMesh/index.md | 26 +++ .../examples/_DisplayElementData_test_1.md | 5 +- .../_InitiateEdgeConnectivity_test_1.md | 34 +++ .../_InitiateElementToElements_test_1.md | 34 +++ .../_InitiateFaceConnectivity_test_1.md | 38 ++++ .../_InitiateFaceConnectivity_test_2.md | 43 ++++ .../Mesh/examples/_Initiate_test_1.md | 8 +- .../Mesh/examples/_Initiate_test_2.md | 7 +- .../Mesh/examples/_Initiate_test_3.md | 14 +- .../ReferenceElement/ElementTopology.md | 18 +- .../ReferenceElement/FacetElements.md | 30 ++- .../ReferenceElement/ReferenceTopology.md | 32 ++- .../examples/_ElementName_test_1.md | 47 ++++ .../examples/_ElementType_test_1.md | 47 ++++ .../examples/_GetFacetElements_test_1.md | 22 ++ .../examples/_GetFacetElements_test_2.md | 22 ++ .../examples/_GetFacetElements_test_3.md | 17 ++ .../examples/_ReferenceTopology_test_1.md | 16 ++ docs/docs-api/ReferenceHexahedron/Initiate.md | 23 +- .../examples/_ElementName_test_1.md | 13 ++ .../examples/_ElementOrder_test_1.md | 19 ++ .../examples/_ElementType_test_1.md | 27 +++ .../examples/_FacetElements_test_1.md | 20 ++ .../examples/_FacetElements_test_2.md | 17 ++ .../examples/_FacetTopology_test_1.md | 15 ++ .../examples/_GetFaceElemType_test_1.md | 21 ++ .../examples/_HighOrderElement_test_1.md | 16 ++ .../{ => examples}/_Initiate_test_1.md | 6 +- .../{ => examples}/_Initiate_test_2.md | 7 +- .../{ => examples}/_Initiate_test_3.md | 6 +- .../examples/_TotalEntities_test_1.md | 18 ++ .../examples/_TotalNodesInElement_test_1.md | 16 ++ docs/docs-api/ReferenceHexahedron/index.md | 15 +- docs/docs-api/ReferenceLine/Initiate.md | 30 +-- docs/docs-api/ReferenceLine/ReferenceLine_.md | 5 +- .../ReferenceLine/_ReferenceLine_test_1.md | 24 -- .../ReferenceLine/_ReferenceLine_test_2.md | 11 - .../examples/_ElementName_test_1.md | 13 ++ .../examples/_ElementName_test_2.md | 26 +++ .../examples/_FacetTopology_test_1.md | 22 ++ .../{ => examples}/_NNE_test_1.md | 0 .../examples/_ReferenceLine_test_1.md | 30 +++ .../examples/_ReferenceLine_test_2.md | 22 ++ .../examples/_TotalEntities_test_1.md | 16 ++ docs/docs-api/ReferenceLine/index.md | 3 +- .../examples/_ElementName_test_1.md | 11 + .../examples/_ElementName_test_1.md | 11 + docs/docs-api/ReferenceQuadrangle/Initiate.md | 10 +- .../ReferenceQuadrangle_.md | 6 +- .../examples/_ElementName_test_1.md | 12 + .../examples/_FacetElements_test_1.md | 28 +++ .../examples/_FacetElements_test_2.md | 19 ++ .../examples/_FacetTopology_test_1.md | 22 ++ .../examples/_GetEdgeConnectivity_test_1.md | 34 +++ .../{ => examples}/_Initiate_test_1.md | 6 +- .../{ => examples}/_Initiate_test_2.md | 0 .../{ => examples}/_Initiate_test_3.md | 0 .../{ => examples}/_Initiate_test_4.md | 0 .../examples/_TotalEntities_test_1.md | 16 ++ docs/docs-api/ReferenceQuadrangle/index.md | 15 +- .../ReferenceTetrahedron_.md | 8 +- .../ReferenceTetrahedron_test_1.md | 38 ---- .../examples/_ElementName_test_1.md | 13 ++ .../examples/_FacetElements_test_1.md | 20 ++ .../examples/_FacetElements_test_2.md | 18 ++ .../examples/_FacetTopology_test_1.md | 22 ++ .../examples/_GetFaceElemType_test_1.md | 42 ++++ .../examples/_HighOrderElement_test_1.md | 16 ++ .../examples/_Initiate_test_1.md | 205 ++++++++++++++++++ .../examples/_Initiate_test_2.md | 31 +++ .../_TetrahedronVolume3D_test_1.md | 4 + .../examples/_TotalEntities_test_1.md | 21 ++ docs/docs-api/ReferenceTetrahedron/index.md | 7 + .../examples/_ElementName_test_1.md | 16 ++ .../examples/_FacetElements_test_1.md | 22 ++ .../examples/_FacetTopology_test_1.md | 22 ++ .../examples/_GetEdgeConnectivity_test_1.md | 34 +++ .../examples/_HighOrderElement_test_1.md | 22 ++ .../examples/_Initiate_test_1.md | 30 +++ .../examples/_TotalEntities_test_1.md | 16 ++ .../_include/install-system-requirements.md | 18 +- 148 files changed, 4311 insertions(+), 345 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docs/docs-api/Domain/examples/_ExportMesh_test_1.md create mode 100644 docs/docs-api/Domain/examples/_GetBoundingBox_test_1.md create mode 100644 docs/docs-api/Domain/examples/_GetNodeToElements_test_1.md create mode 100644 docs/docs-api/Domain/examples/_GetTotalElements_test_1.md create mode 100644 docs/docs-api/Domain/examples/_GetTotalNodes_test_1.md create mode 100644 docs/docs-api/Domain/examples/_Initiate_test_1.md create mode 100644 docs/docs-api/Domain/examples/_IsNodePresent_test_1.md create mode 100644 docs/docs-api/Domain/examples/_SetMeshFacetElement_test_1.md create mode 100644 docs/docs-api/Domain/examples/_SetMeshMap_test_1.md create mode 100644 docs/docs-api/Domain/examples/_SetSparsity_test_1.md create mode 100644 docs/docs-api/Domain/examples/_maxNptrs_test_1.md create mode 100644 docs/docs-api/FEMesh/FEMesh_.md create mode 100644 docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_DisplayElementData_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_DisplayInternalFacetData_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_DisplayNodeData_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_FacetElement_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_FacetElement_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_FacetElement_test_3.md create mode 100644 docs/docs-api/FEMesh/examples/_FacetElement_test_4.md create mode 100644 docs/docs-api/FEMesh/examples/_FacetElement_test_5.md create mode 100644 docs/docs-api/FEMesh/examples/_FacetElement_test_6.md create mode 100644 docs/docs-api/FEMesh/examples/_FacetElement_test_7.md create mode 100644 docs/docs-api/FEMesh/examples/_GetBoundaryElementData_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetBoundingBox_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_GetBounding_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetElementToElements_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetElementToElements_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_GetMaxNNE_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetMaxNNE_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNNE_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNNE_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNodeConnectivity_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNodeToElements_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNodeToElements_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_20.md create mode 100644 docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_30.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateEdgeConnectivity_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateElemSD_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateElemSD_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateElementToElements_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateFacetElemSD_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_3.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_4.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_3.md create mode 100644 docs/docs-api/FEMesh/examples/_Initiate_test_1.md create mode 100644 docs/docs-api/FEMesh/examples/_Initiate_test_2.md create mode 100644 docs/docs-api/FEMesh/examples/_Initiate_test_3.md create mode 100644 docs/docs-api/FEMesh/examples/_Initiate_test_4.md create mode 100644 docs/docs-api/FEMesh/examples/_Initiate_test_5.md create mode 100644 docs/docs-api/FEMesh/index.md create mode 100644 docs/docs-api/Mesh/examples/_InitiateEdgeConnectivity_test_1.md create mode 100644 docs/docs-api/Mesh/examples/_InitiateElementToElements_test_1.md create mode 100644 docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_1.md create mode 100644 docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_2.md create mode 100644 docs/docs-api/ReferenceElement/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferenceElement/examples/_ElementType_test_1.md create mode 100644 docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_1.md create mode 100644 docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_2.md create mode 100644 docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_3.md create mode 100644 docs/docs-api/ReferenceElement/examples/_ReferenceTopology_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_ElementOrder_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_ElementType_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_2.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_FacetTopology_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_GetFaceElemType_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_HighOrderElement_test_1.md rename docs/docs-api/ReferenceHexahedron/{ => examples}/_Initiate_test_1.md (97%) rename docs/docs-api/ReferenceHexahedron/{ => examples}/_Initiate_test_2.md (97%) rename docs/docs-api/ReferenceHexahedron/{ => examples}/_Initiate_test_3.md (97%) create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_TotalEntities_test_1.md create mode 100644 docs/docs-api/ReferenceHexahedron/examples/_TotalNodesInElement_test_1.md delete mode 100644 docs/docs-api/ReferenceLine/_ReferenceLine_test_1.md delete mode 100644 docs/docs-api/ReferenceLine/_ReferenceLine_test_2.md create mode 100644 docs/docs-api/ReferenceLine/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferenceLine/examples/_ElementName_test_2.md create mode 100644 docs/docs-api/ReferenceLine/examples/_FacetTopology_test_1.md rename docs/docs-api/ReferenceLine/{ => examples}/_NNE_test_1.md (100%) create mode 100644 docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_1.md create mode 100644 docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_2.md create mode 100644 docs/docs-api/ReferenceLine/examples/_TotalEntities_test_1.md create mode 100644 docs/docs-api/ReferencePrism/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferencePyramid/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferenceQuadrangle/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_1.md create mode 100644 docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_2.md create mode 100644 docs/docs-api/ReferenceQuadrangle/examples/_FacetTopology_test_1.md create mode 100644 docs/docs-api/ReferenceQuadrangle/examples/_GetEdgeConnectivity_test_1.md rename docs/docs-api/ReferenceQuadrangle/{ => examples}/_Initiate_test_1.md (95%) rename docs/docs-api/ReferenceQuadrangle/{ => examples}/_Initiate_test_2.md (100%) rename docs/docs-api/ReferenceQuadrangle/{ => examples}/_Initiate_test_3.md (100%) rename docs/docs-api/ReferenceQuadrangle/{ => examples}/_Initiate_test_4.md (100%) create mode 100644 docs/docs-api/ReferenceQuadrangle/examples/_TotalEntities_test_1.md delete mode 100644 docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_test_1.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_1.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_2.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_FacetTopology_test_1.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_GetFaceElemType_test_1.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_HighOrderElement_test_1.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_1.md create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_2.md rename docs/docs-api/ReferenceTetrahedron/{ => examples}/_TetrahedronVolume3D_test_1.md (85%) create mode 100644 docs/docs-api/ReferenceTetrahedron/examples/_TotalEntities_test_1.md create mode 100644 docs/docs-api/ReferenceTriangle/examples/_ElementName_test_1.md create mode 100644 docs/docs-api/ReferenceTriangle/examples/_FacetElements_test_1.md create mode 100644 docs/docs-api/ReferenceTriangle/examples/_FacetTopology_test_1.md create mode 100644 docs/docs-api/ReferenceTriangle/examples/_GetEdgeConnectivity_test_1.md create mode 100644 docs/docs-api/ReferenceTriangle/examples/_HighOrderElement_test_1.md create mode 100644 docs/docs-api/ReferenceTriangle/examples/_Initiate_test_1.md create mode 100644 docs/docs-api/ReferenceTriangle/examples/_TotalEntities_test_1.md diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..2a337eab3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,158 @@ +.git +.github +*.out +*.o +build +*/build/* + +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +.DS_Store +.$* + +~* + +build +build/* + +*.mtx +*.eps +*.pdf +*.msh +*.geo +*.F90 +*.txt +*.gp +*.ps +*.py +*.h5 +*.vtu + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1615581ef..544853fb7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,49 +5,49 @@ # This job will be called deploy. # -name: GitHub Pages - -on: - push: - branches: - - master - - main - paths: - - ".github/workflows/deploy.yml" - # Review gh actions docs if you want to further define triggers, paths, etc - # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on - -permissions: - contents: write - -jobs: - deploy: - name: Deploy to GitHub Pages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 21 - cache: yarn - - - name: Install dependencies - run: yarn install --frozen-lockfile - - name: Build website - run: NODE_OPTIONS=--max-old-space-size=4096 yarn build - - # Popular action to deploy to GitHub Pages: - # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Build output to publish to the `gh-pages` branch: - publish_dir: ./build - # The following lines assign commit authorship to the official - # GH-Actions bot for deploys to `gh-pages` branch: - # https://github.com/actions/checkout/issues/13#issuecomment-724415212 - # The GH actions bot is used by default if you didn't specify the two fields. - # You can swap them out with your own user credentials. - user_name: vickysharma0812 - user_email: vickysharma0812@gmail.com +# name: GitHub Pages +# +# on: +# push: +# branches: +# - master +# - main +# paths: +# - ".github/workflows/deploy.yml" +# # Review gh actions docs if you want to further define triggers, paths, etc +# # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on +# +# permissions: +# contents: write +# +# jobs: +# deploy: +# name: Deploy to GitHub Pages +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 21 +# cache: yarn +# +# - name: Install dependencies +# run: yarn install --frozen-lockfile +# - name: Build website +# run: NODE_OPTIONS=--max-old-space-size=4096 yarn build +# +# # Popular action to deploy to GitHub Pages: +# # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus +# - name: Deploy to GitHub Pages +# uses: peaceiris/actions-gh-pages@v3 +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} +# # Build output to publish to the `gh-pages` branch: +# publish_dir: ./build +# # The following lines assign commit authorship to the official +# # GH-Actions bot for deploys to `gh-pages` branch: +# # https://github.com/actions/checkout/issues/13#issuecomment-724415212 +# # The GH actions bot is used by default if you didn't specify the two fields. +# # You can swap them out with your own user credentials. +# user_name: vickysharma0812 +# user_email: vickysharma0812@gmail.com diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 027f40bcb..15234ea69 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -5,28 +5,28 @@ # This job will be called test-deploy. # # -name: Test deployment - -on: - pull_request: - branches: - - master - - main - # Review gh actions docs if you want to further define triggers, paths, etc - # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on - -jobs: - test-deploy: - name: Test deployment - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 21 - cache: yarn - - - name: Install dependencies - run: yarn install --frozen-lockfile - - name: Test build website - run: NODE_OPTIONS=--max-old-space-size=4096 yarn build +# name: Test deployment +# +# on: +# pull_request: +# branches: +# - master +# - main +# # Review gh actions docs if you want to further define triggers, paths, etc +# # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on +# +# jobs: +# test-deploy: +# name: Test deployment +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 21 +# cache: yarn +# +# - name: Install dependencies +# run: yarn install --frozen-lockfile +# - name: Test build website +# run: NODE_OPTIONS=--max-old-space-size=4096 yarn build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..dee94eae1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +# syntax=docker/dockerfile:1 + +# Stage 1: Base image. +## Start with a base image containing NodeJS so we can build Docusaurus. +FROM node:lts as base +## Disable colour output from yarn to make logs easier to read. +ENV FORCE_COLOR=0 +## Enable corepack. +RUN corepack enable +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus + +# Stage 2a: Development mode. +FROM base as dev +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus +## Expose the port that Docusaurus will run on. +EXPOSE 3000 +## Run the development server. +CMD [ -d "node_modules" ] && yarn start || yarn install && yarn start --host 0.0.0.0 + +# Stage 2b: Production build mode. +FROM base as prod +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus +## Copy over the source code. +COPY . /opt/docusaurus/ +## Install dependencies with `--immutable` to ensure reproducibility. +RUN yarn install --immutable +## Build the static site. +RUN yarn build + +# Stage 3a: Serve with `docusaurus serve`. +FROM prod as serve +## Expose the port that Docusaurus will run on. +EXPOSE 3000 +## Run the production server. +CMD ["yarn", "serve", "--host 0.0.0.0", "--no-open"] + +# Stage 3b: Serve with Caddy. +FROM caddy:2-alpine as caddy +## Copy the Caddyfile. +COPY --from=prod /opt/docusaurus/Caddyfile /etc/caddy/Caddyfile +## Copy the Docusaurus build output. +COPY --from=prod /opt/docusaurus/build /var/docusaurus diff --git a/docs/docs-api/Domain/examples/_ExportMesh_test_1.md b/docs/docs-api/Domain/examples/_ExportMesh_test_1.md new file mode 100644 index 000000000..f8f8c0452 --- /dev/null +++ b/docs/docs-api/Domain/examples/_ExportMesh_test_1.md @@ -0,0 +1,31 @@ +This example shows how to convert the domain data from `MSHFile_` format to `HDF5File_` format. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE(MSHFile_) :: mshFile + TYPE(HDF5File_) :: hdf5File + + ! Open mesh file, which is in [[HDF5File_]] file format. + ! It is a three setup process; Initiate, open and read. + + CALL mshFile%Initiate("./mesh.msh", STATUS="OLD", ACTION="READ") + CALL mshFile%Open() + CALL mshFile%Read() + + ! Open the [[HDF5File_]] so that we can export data to + ! it from mesh file [[MSHFile_]]. + + CALL hdf5File%Initiate("./mesh.h5", MODE="NEW") + CALL hdf5File%Open() + + ! Export mesh file to [[HDF5File_]]. + + CALL mshFile%Export(hdf5=hdf5File, group="") + + CALL hdf5File%Deallocate() + CALL mshFile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_GetBoundingBox_test_1.md b/docs/docs-api/Domain/examples/_GetBoundingBox_test_1.md new file mode 100644 index 000000000..4f40fe08b --- /dev/null +++ b/docs/docs-api/Domain/examples/_GetBoundingBox_test_1.md @@ -0,0 +1,27 @@ +This example show how to get bounding box of a domain. + +```fortran +PROGRAM main +USE easifemBase +USE easifemClasses +IMPLICIT NONE +TYPE(Domain_) :: dom +TYPE(HDF5File_) :: meshfile +CHARACTER(*), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh.h5" + +CALL meshfile%Initiate(filename, "READ") +CALL meshfile%Open() + +CALL dom%Initiate(meshfile, '') + +! Now let us get the bounding box of the domain +! by using the method called `GetBoundingBox()`. + +CALL Display(dom%GetBoundingBox(), "Box : ") + +CALL dom%Deallocate() +CALL meshfile%Close() +CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_GetNodeToElements_test_1.md b/docs/docs-api/Domain/examples/_GetNodeToElements_test_1.md new file mode 100644 index 000000000..4d03c0835 --- /dev/null +++ b/docs/docs-api/Domain/examples/_GetNodeToElements_test_1.md @@ -0,0 +1,75 @@ +This example shows how to initiates an instance of `Domain_` from the `HDF5File` mesh/domain file. +It also tests following methods. + +- `isElementPresent` +- `GetConnectivity` +- `GetNodeToElements` + +```fortran +PROGRAM main +USE easifemBase +USE easifemClasses +IMPLICIT NONE + +TYPE(Domain_) :: obj +CLASS(Mesh_), POINTER :: meshptr +TYPE(HDF5File_) :: meshfile +INTEGER(I4B) :: iel +INTEGER(I4B), ALLOCATABLE :: nptrs(:) +CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + +! Initiates the [[HDF5File_]] and OPEN it. + +CALL meshfile%Initiate(filename,"READ") +CALL meshfile%Open() + +! Initiates an instance of [[Domain_]]. + +CALL obj%Initiate(meshfile, '') + +! Let us now test `isElementPresent` method, which returns true IF a given global element is present in the domain. + +DO iel = obj%minElemNum, obj%maxElemNum + IF(.NOT. obj%isElementPresent(iel)) THEN + CALL fail("isElementPresent error code 1") + STOP + END IF +END DO +CALL PASS("isElementPresent") + +! The following code-block shows how to USE `GetConnectivity` method to get the connectivity of an element. + +meshptr => obj%GetMeshPointer(dim=2, entityNum=1) +DO iel = meshptr%minElemNum, meshptr%maxElemNum + IF( .NOT. meshptr%isElementPresent(iel) ) CYCLE + + IF( ANY( meshptr%GetConnectivity(iel) .NE. & + & obj%GetConnectivity(iel) ) ) THEN + CALL fail("GetConnectivity error code 2") + STOP + END IF +END DO +CALL PASS("GetConnectivity") + +! Following code-block shows how to USE `GetNodeToElements` + +CALL OK(obj%GetNodeToElements(5) .in. [15, 17, 24], "GetNodeToElements: ") + +! Note that the 41 and 42 are the line elements connected to node 35 as shown in figure below. + +IF( size(obj%GetNodeToElements(0)) .ne. 0 ) THEN + CALL FAIL("GetNodeToElements error code 3") + STOP +ELSE + CALL PASS("GetNodeToElements") +END IF + +! Test: test how absent nodes are handled. Here, node 0 is absent. + +CALL OK(obj%GetNodeToElements([5,0]) .in. [15, 17, 24], "GetNodeToElements") + +meshptr => NULL() +CALL meshfile%Deallocate() +CALL obj%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_GetTotalElements_test_1.md b/docs/docs-api/Domain/examples/_GetTotalElements_test_1.md new file mode 100644 index 000000000..8cecbe3a3 --- /dev/null +++ b/docs/docs-api/Domain/examples/_GetTotalElements_test_1.md @@ -0,0 +1,53 @@ +This example show how to initiate an instance of `Domain_` from the `HDF5File_` +mesh/domain file. + +It tests `GetTotalElements`, and `OPERATOR(.tElements.)` methods + +``` fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE(Domain_) :: obj + TYPE(HDF5File_) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + INTEGER( I4B ), PARAMETER :: telems_0d = 4, telems_1d = 8, telems_2d = 14, telems_3d=0, telems = 26 + + CALL meshfile%Initiate(filename, "READ") + CALL meshfile%Open() + + CALL obj%Initiate(meshfile, '') + + ! Let us now demonstrate the usage of `GetTotalElements` + ! which returns the total number of Elements in the + ! [[Domain_]], or part of domain (i.e. [[Mesh_]]) + + ! Let us Get total number of Elements in the domain. + + CALL IS( obj%GetTotalElements(), telems, "GetTotalElements: " ) + + ! Let us not Get total number of Elements + CALL IS( obj%GetTotalElements(dim=2, entityNum=1), telems_2d, & + & "obj%GetTotalElements(dim=2, entityNum=1): " ) + + ! Let us now Get total number of Elements in 2D, i.e. Elements in all 2D mesh. + CALL IS( obj%GetTotalElements(dim=2), telems_2d, "obj%GetTotalElements(dim=2): " ) + + ! Let us now Get total number of Elements in 1D, i.e. Elements in all 1D mesh. + CALL IS( obj%GetTotalElements(dim=1), telems_1d, "obj%GetTotalElements(dim=1): " ) + + CALL IS( .tElements. obj, telems, ".tElements. obj: " ) + + ! Let us not Get total number of Elements in the left mesh [[Mesh_]] + CALL IS( obj .tElements. [2,1], telems_2d, "obj .tElements. [2,1]: " ) + + ! Let us now Get total number of Elements in 2D, i.e. Elements in all 2D mesh. + CALL IS( obj .tElements. 2, telems_2d, "obj .tElements. 2: " ) + + ! Let us now Get total number of Elements in 1D, i.e. Elements in all 1D mesh. + CALL IS( obj .tElements. 1, telems_1d, "obj .tElements. 1: " ) + + CALL meshfile%Deallocate() + CALL obj%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_GetTotalNodes_test_1.md b/docs/docs-api/Domain/examples/_GetTotalNodes_test_1.md new file mode 100644 index 000000000..49ae333a7 --- /dev/null +++ b/docs/docs-api/Domain/examples/_GetTotalNodes_test_1.md @@ -0,0 +1,53 @@ +This example show how to initiate an instance of `Domain_` from the `HDF5File_` mesh/domain file. +It tests `GetTotalNodes` and `Operator(.tNodes.)` methods. + +``` fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE(Domain_) :: obj + TYPE(HDF5File_) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + INTEGER( I4B ), PARAMETER :: domain_tNodes = 12, dim1_tNodes = 8 + + ! initiates the [[HDF5File_]] and OPEN it + + CALL meshfile%Initiate(filename, "READ") + CALL meshfile%Open() + + ! Initiates an instance of [[Domain_]] + + CALL obj%Initiate(meshfile, '') + + + ! Let us now demonstrate the usage of `GetTotalNodes` which + ! returns the total number of nodes in the [[Domain_]], + ! or part of domain (i.e. [[Mesh_]]) + + ! Let us Get total number of nodes in the domain. + CALL OK( obj%GetTotalNodes() .EQ. domain_tNodes, "GetTotalNodes: " ) + + ! Let us not Get total number of nodes in the left mesh [[Mesh_]] + CALL OK( obj%GetTotalNodes(dim=2, entityNum=1) .eq. domain_tNodes, & + & "obj%GetTotalNodes(dim=2, entityNum=1): " ) + + ! It is an error to get nodes like given below. + ! CALL OK( domain_tNodes .eq. obj%GetTotalNodes(dim=2), & + ! & "obj%GetTotalNodes(dim=2): " ) + + + ! We can also Get total number of nodes using the operator called `.tNodes.`. + + ! To Get total number of nodes in the domain use the following. + CALL OK( domain_tNodes .eq. (.tNodes. obj), "(.tNodes. obj): " ) + + ! To Get total number of nodes in given dimension `dim` and entity Number, + ! pack them in a vector of length two, that is `[dim, entityNum]`, + ! and pass it to `.tNodes.` as shown below. + CALL OK( domain_tNodes .eq. (obj .tNodes. [2, 1]), "obj .tNodes. [2, 1]: " ) + + CALL meshfile%Deallocate() + CALL obj%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_Initiate_test_1.md b/docs/docs-api/Domain/examples/_Initiate_test_1.md new file mode 100644 index 000000000..b0b9d8eb0 --- /dev/null +++ b/docs/docs-api/Domain/examples/_Initiate_test_1.md @@ -0,0 +1,21 @@ +This example show how to initiate an instance of `Domain_` from the `HDF5File_` mesh/domain file. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE(Domain_) :: dom + TYPE(HDF5File_) :: meshfile + CHARACTER(*), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh_3d.h5" + + CALL meshfile%Initiate(filename, mode="READ") + CALL meshfile%Open() + + CALL dom%Initiate(meshfile, '') + + CALL dom%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_IsNodePresent_test_1.md b/docs/docs-api/Domain/examples/_IsNodePresent_test_1.md new file mode 100644 index 000000000..1a566782b --- /dev/null +++ b/docs/docs-api/Domain/examples/_IsNodePresent_test_1.md @@ -0,0 +1,31 @@ +This example show how to initiate an instance of `Domain_` from the `HDF5File_` mesh/domain file. +It tests `isNodePresent`, `getTotalNodes`, and `Operator(.tNodes.)` methods + +``` fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE(Domain_) :: obj + TYPE(HDF5File_) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + + ! initiates the [[HDF5File_]] and OPEN it + + CALL meshfile%Initiate(filename, "READ") + CALL meshfile%Open() + +! Initiates an instance of [[Domain_]] + + CALL obj%Initiate(meshfile, '') + + ! Let us now test `isNodePresent` method, + ! which returns true IF a given global node is present in the domain. + + CALL OK( obj%isNodePresent( 1 ), "isNodePresent : " ) + CALL OK( .NOT. (obj%isNodePresent( 0 )), "isNodePresent : " ) + + CALL meshfile%Deallocate() + CALL obj%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_SetMeshFacetElement_test_1.md b/docs/docs-api/Domain/examples/_SetMeshFacetElement_test_1.md new file mode 100644 index 000000000..1514f44f5 --- /dev/null +++ b/docs/docs-api/Domain/examples/_SetMeshFacetElement_test_1.md @@ -0,0 +1,25 @@ +This example tests the `SetMeshFacetElement` method of the domain. + +``` fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE(Domain_) :: obj + TYPE(HDF5File_) :: domfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + + CALL domfile%Initiate(filename, "READ") + CALL domfile%Open() + + CALL obj%Initiate(domfile, '') + + CALL obj%SetMeshMap() + CALL obj%SetMeshFacetElement() + CALL obj%DisplayMeshFacetData( "MeshFacetData = " ) + CALL Display( "OK" ) + + CALL obj%Deallocate() + CALL domfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_SetMeshMap_test_1.md b/docs/docs-api/Domain/examples/_SetMeshMap_test_1.md new file mode 100644 index 000000000..ce081d0bb --- /dev/null +++ b/docs/docs-api/Domain/examples/_SetMeshMap_test_1.md @@ -0,0 +1,29 @@ +This example tests the `SetMeshMap` method of the domain. + +``` fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE(Domain_) :: obj + TYPE(HDF5File_) :: domfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + + ! Open the mesh file. + + CALL domfile%Initiate(filename, "READ") + CALL domfile%Open() + + ! Initiate the domain. + + CALL obj%Initiate(domfile, '') + + ! Setting `MeshFacetData` of the domain. + + CALL obj%SetMeshMap() + CALL Display( "OK" ) + + CALL obj%Deallocate() + CALL domfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Domain/examples/_SetSparsity_test_1.md b/docs/docs-api/Domain/examples/_SetSparsity_test_1.md new file mode 100644 index 000000000..d9b62b123 --- /dev/null +++ b/docs/docs-api/Domain/examples/_SetSparsity_test_1.md @@ -0,0 +1,64 @@ +This example show how to initiate an instance of `Domain_`, `DOF_`, `CSRMatrix_` +and set the sparsity pattern in the sparse matrix. +The velocity domain is given below. + +```fortran +PROGRAM main +USE easifemBase +USE easifemClasses +IMPLICIT NONE +TYPE( Domain_ ), TARGET :: pressureDomain +TYPE( Domain_ ), TARGET :: velocityDomain +TYPE( DomainPointer_ ) :: domains( 2 ) +TYPE( HDF5File_ ) :: pressureMeshFile +TYPE( HDF5File_ ) :: velocityMeshFile +TYPE( CSRMatrix_ ) :: mat +TYPE( DOF_ ) :: dofobj +CHARACTER(*), PARAMETER :: filename_velocity= & + & "../../Mesh/examples/meshdata/small_tri6_mesh.h5" +CHARACTER(*), PARAMETER :: filename_pressure= & + & "../../Mesh/examples/meshdata/small_tri3_mesh.h5" + +! Open meshfile for velocity and pressure variable. +CALL velocityMeshFile%Initiate( fileName=filename_velocity, mode="READ" ) +CALL velocityMeshFile%Open() +CALL pressureMeshFile%Initiate( fileName=filename_pressure, mode="READ" ) +CALL pressureMeshFile%Open() + +! Initiates domain for pressure and velocity variable. +CALL velocityDomain%Initiate( velocityMeshFile, "") +CALL pressureDomain%Initiate( pressureMeshFile, "") +domains(1)%ptr => velocityDomain +domains(2)%ptr => pressureDomain + +! Now that the domain is ready, we can create a degree of freedom object DOF. + +CALL Initiate( obj=dofobj, & + & tNodes=[.tNodes. velocityDomain, .tNodes. pressureDomain], & + & names=['V', 'P'], & + & spaceCompo=[2, 1], & + & timeCompo=[1,1], & + & storageFMT=FMT_DOF) + +! Initiate an instance of [CSRMatrix](../CSRMatrix/CSRMatrix_.md), mat. + +CALL Initiate( mat, ncol=.tnodes. dofobj, nrow=.tnodes. dofobj, & + & dof=dofobj ) + +! Now we will pass mat to domain and set the sparsity pattern. + +CALL velocityDomain%SetSparsity( domains=domains, mat=mat ) +CALL SPY( mat, "test_5", ".png") + +CALL Deallocate( mat ) +NULLIFY(domains(1)%ptr, domains(2)%ptr) +CALL pressureDomain%Deallocate() +CALL velocityDomain%Deallocate() +CALL velocityMeshFile%Deallocate() +CALL pressureMeshFile%Deallocate() +END PROGRAM main +``` + +The result of this program is given below. + +![](../figures/test_5.png) diff --git a/docs/docs-api/Domain/examples/_maxNptrs_test_1.md b/docs/docs-api/Domain/examples/_maxNptrs_test_1.md new file mode 100644 index 000000000..bd97c4e8b --- /dev/null +++ b/docs/docs-api/Domain/examples/_maxNptrs_test_1.md @@ -0,0 +1,33 @@ +This example show how to get maximum and minimum node/element number inside the domain. + +```fortran +PROGRAM main +USE easifemBase +USE easifemClasses +IMPLICIT NONE +TYPE(Domain_) :: obj +TYPE(HDF5File_) :: meshfile +CHARACTER(*), PARAMETER :: & + & filename="../../Mesh/examples/meshdata/small_mesh.h5" + +CALL meshfile%Initiate(filename,"READ") +CALL meshfile%Open() + +CALL obj%Initiate(meshfile, '') + +! We can obtain the largest and smallest node number +! by using `obj%maxNptrs` and `obj%minNptrs` + +CALL Display(obj%maxNptrs, "maxNptrs : ") +CALL Display(obj%minNptrs, "minNptrs : ") + +! We can obtain the largest and smallest element number +! by using `obj%maxElemNum` and `obj%minElemNum` + +CALL Display(obj%maxElemNum, "maxElemNum : ") +CALL Display(obj%minElemNum, "minElemNum : ") + +CALL obj%Deallocate() +CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/EdgeData/examples/_test_1.md b/docs/docs-api/EdgeData/examples/_test_1.md index 986f49034..f7cf8c802 100644 --- a/docs/docs-api/EdgeData/examples/_test_1.md +++ b/docs/docs-api/EdgeData/examples/_test_1.md @@ -1,30 +1,15 @@ -! This program is a part of EASIFEM library -! Copyright (C) 2020-2021 Vikas Sharma, Ph.D -! -! This program is free software: you can redistribute it and/or modify -! it under the terms of the GNU General Public License as published by -! the Free Software Foundation, either version 3 of the License, or -! (at your option) any later version. -! -! This program is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -! GNU General Public License for more details. -! -! You should have received a copy of the GNU General Public License -! along with this program. If not, see -! - +```fortran PROGRAM main USE easifemBase USE easifemClasses -USE EdgeBinaryTree_Class -USE EdgeTreeData_Class +USE EdgeData_Class +USE EdgeDataBinaryTree_Class +USE EdgeDataBinaryTreeUtility IMPLICIT NONE -TYPE(EdgeTreeData_) :: VALUE -TYPE(EdgeTreeData_), POINTER :: value_ptr -TYPE(EdgeBinaryTree_) :: obj, anode +TYPE(EdgeData_) :: VALUE +TYPE(EdgeData_), POINTER :: value_ptr +TYPE(EdgeDataBinaryTree_) :: obj, anode INTEGER(I4B), ALLOCATABLE :: node_connectivity(:, :), edge_connectivity(:, :) INTEGER(I4B) :: localEdges(2, 4), nptrs(4), edge(2), sorted_edge(2) INTEGER(I4B) :: iel, iedge, tsize1, tsize2 @@ -54,7 +39,7 @@ DO iel = 1, SIZE(node_connectivity, 2) edge = nptrs(localEdges(:, iedge)) sorted_edge = SORT(edge) - value_ptr => EdgeTreeData_Pointer(sorted_edge) + value_ptr => EdgeData_Pointer(sorted_edge) tsize1 = obj%SIZE() CALL obj%Insert(value_ptr) @@ -95,8 +80,9 @@ CALL obj%Remove(anode) CALL EqualLine() -CALL EdgeBinaryTree_RenumberEdges(obj) +CALL obj%SetID() CALL obj%Display("after removing some edges:") END PROGRAM main +``` diff --git a/docs/docs-api/EdgeData/examples/_test_2.md b/docs/docs-api/EdgeData/examples/_test_2.md index 7dd79ddfa..8954e8daf 100644 --- a/docs/docs-api/EdgeData/examples/_test_2.md +++ b/docs/docs-api/EdgeData/examples/_test_2.md @@ -1,30 +1,14 @@ -! This program is a part of EASIFEM library -! Copyright (C) 2020-2021 Vikas Sharma, Ph.D -! -! This program is free software: you can redistribute it and/or modify -! it under the terms of the GNU General Public License as published by -! the Free Software Foundation, either version 3 of the License, or -! (at your option) any later version. -! -! This program is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -! GNU General Public License for more details. -! -! You should have received a copy of the GNU General Public License -! along with this program. If not, see -! - +```fortran PROGRAM main USE easifemBase USE easifemClasses -USE EdgeBinaryTree_Class -USE EdgeTreeData_Class +USE EdgeDataBinaryTree_Class +USE EdgeData_Class IMPLICIT NONE -TYPE(EdgeTreeData_) :: VALUE -TYPE(EdgeTreeData_), POINTER :: value_ptr -TYPE(EdgeBinaryTree_) :: obj, anode +TYPE(EdgeData_) :: VALUE +TYPE(EdgeData_), POINTER :: value_ptr +TYPE(EdgeDataBinaryTree_) :: obj, anode INTEGER(I4B), ALLOCATABLE :: node_connectivity(:, :) INTEGER(I4B) :: localEdges(2, 4), nptrs(4), edge(2), sorted_edge(2) INTEGER(I4B) :: iel, iedge @@ -48,7 +32,7 @@ DO iel = 1, SIZE(node_connectivity, 2) DO iedge = 1, SIZE(localEdges, 2) edge = nptrs(localEdges(:, iedge)) sorted_edge = SORT(edge) - value_ptr => EdgeTreeData_Pointer(sorted_edge) + value_ptr => EdgeData_Pointer(sorted_edge) CALL obj%Insert(value_ptr) END DO @@ -72,3 +56,4 @@ CALL obj%SetID() CALL obj%Display("after renumbering") END PROGRAM main +``` diff --git a/docs/docs-api/EdgeData/examples/_test_3.md b/docs/docs-api/EdgeData/examples/_test_3.md index 2db40a42d..eec4491eb 100644 --- a/docs/docs-api/EdgeData/examples/_test_3.md +++ b/docs/docs-api/EdgeData/examples/_test_3.md @@ -1,32 +1,16 @@ -! This program is a part of EASIFEM library -! Copyright (C) 2020-2021 Vikas Sharma, Ph.D -! -! This program is free software: you can redistribute it and/or modify -! it under the terms of the GNU General Public License as published by -! the Free Software Foundation, either version 3 of the License, or -! (at your option) any later version. -! -! This program is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -! GNU General Public License for more details. -! -! You should have received a copy of the GNU General Public License -! along with this program. If not, see -! - +```fortran PROGRAM main USE easifemBase USE easifemClasses -USE EdgeTreeData_Class -USE EdgeBinaryTree_Class -USE EdgeBinaryTreeUtility +USE EdgeData_Class +USE EdgeDataBinaryTree_Class +USE EdgeDataBinaryTreeUtility IMPLICIT NONE -TYPE(EdgeTreeData_) :: VALUE -TYPE(EdgeTreeData_), POINTER :: value_ptr -TYPE(EdgeBinaryTree_) :: obj, anode +TYPE(EdgeData_) :: VALUE +TYPE(EdgeData_), POINTER :: value_ptr +TYPE(EdgeDataBinaryTree_) :: obj, anode INTEGER(I4B), ALLOCATABLE :: node_connectivity(:, :), edgeArray(:, :) INTEGER(I4B) :: localEdges(2, 4), nptrs(4), edge(2), sorted_edge(2) INTEGER(I4B) :: iel, iedge @@ -48,7 +32,7 @@ DO iel = 1, SIZE(node_connectivity, 2) DO iedge = 1, SIZE(localEdges, 2) edge = nptrs(localEdges(:, iedge)) sorted_edge = SORT(edge) - value_ptr => EdgeTreeData_Pointer(sorted_edge) + value_ptr => EdgeData_Pointer(sorted_edge) CALL obj%Insert(value_ptr) END DO END DO @@ -57,8 +41,9 @@ CALL obj%SetID() CALL Reallocate(edgeArray, 2, obj%SIZE()) -CALL EdgeBinaryTree_GetArray(obj, edgeArray) +CALL EdgeDataBinaryTree_GetArray(obj, edgeArray) CALL Display(edgeArray, "edges: ") END PROGRAM main +``` diff --git a/docs/docs-api/EdgeData/examples/_test_4.md b/docs/docs-api/EdgeData/examples/_test_4.md index 16b885004..46d2e2788 100644 --- a/docs/docs-api/EdgeData/examples/_test_4.md +++ b/docs/docs-api/EdgeData/examples/_test_4.md @@ -1,34 +1,16 @@ -! This program is a part of EASIFEM library -! Copyright (C) 2020-2021 Vikas Sharma, Ph.D -! -! This program is free software: you can redistribute it and/or modify -! it under the terms of the GNU General Public License as published by -! the Free Software Foundation, either version 3 of the License, or -! (at your option) any later version. -! -! This program is distributed in the hope that it will be useful, -! but WITHOUT ANY WARRANTY; without even the implied warranty of -! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -! GNU General Public License for more details. -! -! You should have received a copy of the GNU General Public License -! along with this program. If not, see -! - -! In this example, I will show how to make edge_connectivity of mesh - +```fortran PROGRAM main USE easifemBase USE easifemClasses -USE EdgeTreeData_Class -USE EdgeBinaryTree_Class -USE EdgeBinaryTreeUtility +USE EdgeData_Class +USE EdgeDataBinaryTree_Class +USE EdgeDataBinaryTreeUtility IMPLICIT NONE -TYPE(EdgeTreeData_) :: VALUE -TYPE(EdgeTreeData_), POINTER :: value_ptr -TYPE(EdgeBinaryTree_) :: obj, anode +TYPE(EdgeData_) :: VALUE +TYPE(EdgeData_), POINTER :: value_ptr +TYPE(EdgeDataBinaryTree_) :: obj, anode INTEGER(I4B), ALLOCATABLE :: node_connectivity(:, :), edge_connectivity(:, :) INTEGER(I4B) :: localEdges(2, 4), nptrs(4), edge(2), sorted_edge(2) INTEGER(I4B) :: iel, iedge @@ -50,7 +32,7 @@ DO iel = 1, SIZE(node_connectivity, 2) DO iedge = 1, SIZE(localEdges, 2) edge = nptrs(localEdges(:, iedge)) sorted_edge = SORT(edge) - value_ptr => EdgeTreeData_Pointer(sorted_edge) + value_ptr => EdgeData_Pointer(sorted_edge) CALL obj%Insert(value_ptr) END DO END DO @@ -80,3 +62,4 @@ END DO CALL Display(edge_connectivity, "edge_connectivity:") END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/FEMesh_.md b/docs/docs-api/FEMesh/FEMesh_.md new file mode 100644 index 000000000..7ff7c1b73 --- /dev/null +++ b/docs/docs-api/FEMesh/FEMesh_.md @@ -0,0 +1,6 @@ +--- +title: Structure +sidebar_position: 2 +--- + +`FEMesh_` datatype is simply a collection of mesh elements. diff --git a/docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_1.md b/docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_1.md new file mode 100644 index 000000000..67da0e1ba --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_1.md @@ -0,0 +1,30 @@ +This example shows how to use `DisplayBoundaryFacetData` method to display the content of boundary facet data. + +Import modules and declare variables + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. + ! Then, create an instance of mesh. + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Displaying the node data. + + CALL obj%DisplayBoundaryFacetData( "Boundary facet data" ) + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_2.md b/docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_2.md new file mode 100644 index 000000000..86eee510f --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_DisplayBoundaryFacetData_test_2.md @@ -0,0 +1,27 @@ +This example shows how to use `DisplayBoundaryFacetData` method to display the boundary facet data. + +In this example we do create an instance of Domain, therefore, +we build the information about `DOMAIN_BOUNDARY_ELEMENT` and `BOUNDARY_ELEMENT`. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + CLASS( Mesh_ ), POINTER :: obj + TYPE( Domain_ ) :: dom + TYPE( HDF5File_ ) :: domainFile + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + CALL domainFile%Initiate( FileName=filename, MODE="READ" ) + CALL domainFile%Open() + CALL dom%Initiate(hdf5=domainFile, group="" ) + obj => dom%getMeshPointer(dim=dom%getNSD(), entityNum=1) + + CALL obj%DisplayBoundaryFacetData( "BoundaryFacetData = " ) + + CALL obj%Deallocate() + CALL domainFile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_DisplayElementData_test_1.md b/docs/docs-api/FEMesh/examples/_DisplayElementData_test_1.md new file mode 100644 index 000000000..b3f0417aa --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_DisplayElementData_test_1.md @@ -0,0 +1,35 @@ +This example shows how to use `DisplayElementData` method to display the content of element data inside the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./meshdata/small_mesh.h5" +``` + +Initiate and open the mesh file which is in HDF5File format. +Then, create an instance of mesh. + +```fortran +CALL meshfile%Initiate( FileName=filename, MODE="READ" ) +CALL meshfile%Open() +CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) +``` + +Displaying the element data. + +```fortran +CALL obj%DisplayElementData( "element data" ) +CALL Display( "OK" ) +``` + +```fortran + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_DisplayInternalFacetData_test_1.md b/docs/docs-api/FEMesh/examples/_DisplayInternalFacetData_test_1.md new file mode 100644 index 000000000..26aa5bf90 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_DisplayInternalFacetData_test_1.md @@ -0,0 +1,25 @@ +This example shows how to use `DisplayInternalFacetData` method to display the content of internal facet data. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Displaying the node data. + CALL obj%DisplayInternalFacetData( "Internal facet data" ) + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_DisplayNodeData_test_1.md b/docs/docs-api/FEMesh/examples/_DisplayNodeData_test_1.md new file mode 100644 index 000000000..953e0e727 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_DisplayNodeData_test_1.md @@ -0,0 +1,24 @@ +This example shows how to use `DisplayNodeData` method to display the content of element data inside the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + CALL obj%DisplayNodeData( "node data" ) + + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_FacetElement_test_1.md b/docs/docs-api/FEMesh/examples/_FacetElement_test_1.md new file mode 100644 index 000000000..7967a2297 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_FacetElement_test_1.md @@ -0,0 +1,73 @@ +This example shows the use of some simple methods related to the internal facet elements of the mesh. + +- In this example we do not create a domain, therefore, we have no information about the MeshFacetData. +- This information is only avaiable when we create a domain. +- This is because `MeshFacetData` denotes the interface between two meshes. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. + ! Then, create an instance of mesh. + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Getting the total number of Internal Facet elements in the mesh. + + CALL Display( obj%GetTotalInternalFacetElements(), & + & "GetTotalInternalFacetElements=") + + ! Getting the total number of boundary facet elements in the mesh. + + CALL Display( obj%getTotalBoundaryFacetElements(), & + & "getTotalBoundaryFacetElements=") + + ! Getting the total number of Domain Facet elements in the mesh. + + CALL Display( obj%getTotalDomainFacetElements(), & + & "getTotalDomainFacetElements=") + + ! Getting the total number of Mesh Facet elements in the mesh. + + CALL Display( obj%getTotalMeshFacetElements(), & + & "getTotalMeshFacetElements=") + + ! Getting the master cell number of an internal facet element. + + DO iel = 1, obj%getTotalInternalFacetElements() + CALL Display( obj%getMasterCellNumber( facetElement=iel, & + & elementType=INTERNAL_ELEMENT ), & + & "masterCell( " // tostring( iel ) // " ) = " ) + END DO + + ! Getting the slave number of an internal facet element. + + DO iel = 1, obj%getTotalInternalFacetElements() + CALL Display( obj%getSlaveCellNumber( facetElement=iel, & + & elementType=INTERNAL_ELEMENT ), & + & "SlaveCell( " // tostring( iel ) // " ) = " ) + END DO + + ! Getting the connectivity of an internal facet element + + DO iel = 1, obj%getTotalInternalFacetElements() + CALL Display( obj%getFacetConnectivity( facetElement=iel, & + & elementType=INTERNAL_ELEMENT, isMaster=.TRUE. ), & + & "internalFacetElementData( " // tostring( iel ) // " ) = " ) + END DO + + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_FacetElement_test_2.md b/docs/docs-api/FEMesh/examples/_FacetElement_test_2.md new file mode 100644 index 000000000..1ba0afb2e --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_FacetElement_test_2.md @@ -0,0 +1,78 @@ +This example shows how to obtain the `ReferenceElement_` of an internal facet element. + +- First we obtain the local facet ID of the internal facet element in the masterCell +- Then we use this localFacetID to get the reference element stored in the mesh object. + +We can also follow this procedure for slaveCell number. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ) :: iel, ii, masterCell, slaveCell + CHARACTER(*), PARAMETER :: filename="./mesh.h5" + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. + ! Then, create an instance of mesh. + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Getting the [[ReferenceElement_]] of an internal facet element. + + iel = 1 + CALL Display( "facetElement="//tostring(iel) ) + + ! Getting the master and slave cell number of the facet element. + CALL Display( obj%getCellNumber( facetElement=iel, & + & elementType=INTERNAL_ELEMENT ), & + & "master and slave cell number = " ) + + ! Getting the connectivity information of facet element. + CALL Display( obj%getFacetConnectivity( facetElement=iel, & + & elementType=INTERNAL_ELEMENT, & + & isMaster=.TRUE. ), & + & "facet connectivity=" ) + + ! Obtaining the local facet number of given facet element. + ii = obj%getLocalFacetID( facetElement=iel, & + & elementType=INTERNAL_ELEMENT, & + & isMaster = .TRUE. ) + CALL Display( ii, "localFacetID=" ) + + ! Accessing the reference facet element by using localFacetID. + CALL Display( obj%facetElements( ii ), "refElem=" ) + + ! If we know the cell number and the localFacetID then we can get the connectivity + ! of that facet element by using the following. + masterCell = obj%getMasterCellNumber( facetElement=iel, & + & elementType=INTERNAL_ELEMENT ) + CALL Display( obj%getFacetConnectivity( globalElement=masterCell, & + & iface=ii ), "connectivity of iface=" ) + + ! Now let us repeat this process for slave Cell number. + iel = 1 + CALL Display( "== slave cell number ==") + CALL Display( "facetElement="//tostring(iel) ) + CALL Display( obj%getFacetConnectivity( facetElement=iel, & + & elementType=INTERNAL_ELEMENT, & + & isMaster=.FALSE. ), & + & "facet connectivity=" ) + ii = obj%getLocalFacetID( facetElement=iel, & + & elementType=INTERNAL_ELEMENT, & + & isMaster = .FALSE. ) + CALL Display( ii, "localFacetID=" ) + CALL Display( obj%facetElements( ii ), "refElem=" ) + slaveCell = obj%getSlaveCellNumber( facetElement=iel, & + & elementType=INTERNAL_ELEMENT ) + CALL Display( obj%getFacetConnectivity( globalElement=slaveCell, & + & iface=ii ), "connectivity of iface=" ) + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_FacetElement_test_3.md b/docs/docs-api/FEMesh/examples/_FacetElement_test_3.md new file mode 100644 index 000000000..3244d39c5 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_FacetElement_test_3.md @@ -0,0 +1,57 @@ +This example shows the use of `GetFacetElementType` method of `Mesh_` class. + +In this example we do not create an instance of `Domain_`, therefore, +we cannot create the information about `DOMAIN_BOUNDARY_ELEMENT`. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. + ! Then, create an instance of mesh. + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Getting the facet element type of a given cell element. + ! In this example, cell element is a triangle, so there are 3 faces. + ! Each face can be `INTERNAL_ELEMENT`, DOMAIN_ELEMENT. + ! + ! In the case given below all faces are `INTERNAL_ELEMENT` + iel = 20 + CALL Display( obj%getConnectivity( iel ), "cellElement ("//tostring(iel)& + & // ") = " ) + CALL Display( obj%isBoundaryElement( iel ), "isBoundaryElement=" ) + CALL Display( obj%getFacetElementType( iel ), & + & "facet element type=" ) + + ! In this case two faces are `INTERNAL_ELEMENT`, + ! and one face is `DOMAIN_BOUNDARY_ELEMENT`. + iel = 17 + CALL Display( obj%getConnectivity( iel ), "cellElement ("//tostring(iel)& + & // ") = " ) + CALL Display( obj%isBoundaryElement( iel ), "isBoundaryElement=" ) + CALL Display( obj%getFacetElementType( iel ), & + & "facet element type=" ) + + ! In this case two faces are `INTERNAL_ELEMENT`, + ! and one face is `DOMAIN_BOUNDARY_ELEMENT` + iel = 23 + CALL Display( obj%getConnectivity( iel ), "cellElement ("//tostring(iel)& + & // ") = " ) + CALL Display( obj%getFacetElementType( iel ), & + & "facet element type=" ) + CALL Display( obj%isBoundaryElement( iel ), "isBoundaryElement=" ) + + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_FacetElement_test_4.md b/docs/docs-api/FEMesh/examples/_FacetElement_test_4.md new file mode 100644 index 000000000..215f65029 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_FacetElement_test_4.md @@ -0,0 +1,70 @@ +This example shows the use of `GetFacetElementType` method of [[Mesh_]] class. +This example is similar to example 15. + +In this example we do create an instance of [[Domain_]], therefore, +we build the information about `DOMAIN_BOUNDARY_ELEMENT`. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + CLASS( Mesh_ ), POINTER :: obj + TYPE( Domain_ ) :: dom + TYPE( HDF5File_ ) :: domainFile + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" +``` + +Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + +```fortran +CALL domainFile%Initiate( FileName="./mesh.h5", MODE="READ" ) +CALL domainFile%Open() +CALL dom%Initiate(hdf5=domainFile, group="" ) +obj => dom%getMeshPointer(dim=dom%getNSD(), entityNum=1) +``` + +Getting the facet element type of a given cell element. In this example, cell element is a triangle, so there are 3 faces. Each face can be `INTERNAL_ELEMENT`, DOMAIN_ELEMENT. + +In the case given below all faces are `INTERNAL_ELEMENT` + +```fortran +iel = 20 +CALL Display( obj%getConnectivity( iel ), "cellElement ( "//tostring(iel)& + & // " ) = " ) +CALL Display( obj%isBoundaryElement( iel ), "isBoundaryElement=" ) +CALL Display( obj%getFacetElementType( iel ), & + & "facet element type=" ) +``` + +In this case two faces are `INTERNAL_ELEMENT`, and one face is `DOMAIN_BOUNDARY_ELEMENT`. + +```fortran +iel = 17 +CALL Display( obj%getConnectivity( iel ), "cellElement ( "//tostring(iel)& + & // " ) = " ) +CALL Display( obj%isBoundaryElement( iel ), "isBoundaryElement=" ) +CALL Display( obj%getFacetElementType( iel ), & + & "facet element type=" ) +!! +``` + +In this case two faces are `INTERNAL_ELEMENT`, and one face is `BOUNDARY_ELEMENT` + +```fortran +iel = 23 +CALL Display( obj%getConnectivity( iel ), "cellElement ( "//tostring(iel)& + & // " ) = " ) +CALL Display( obj%getFacetElementType( iel ), & + & "facet element type=" ) +CALL Display( obj%isBoundaryElement( iel ), "isBoundaryElement=" ) +``` + +```fortran + NULLIFY( obj ) + CALL dom%Deallocate() + CALL domainFile%Close() + CALL domainFile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_FacetElement_test_5.md b/docs/docs-api/FEMesh/examples/_FacetElement_test_5.md new file mode 100644 index 000000000..f236e9db2 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_FacetElement_test_5.md @@ -0,0 +1,71 @@ +This example shows the use of some simple methods related to the domain facet elements of the mesh. + +In this example we do not create a domain, therefore, we have no information about the MeshFacetData. This information is only avaiable when we create a domain. this is because `MeshFacetData` denotes the interface between two meshes. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" +``` + +Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + +```fortran +CALL meshfile%Initiate( FileName=filename, MODE="READ" ) +CALL meshfile%Open() +CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) +``` + +Getting the total number of Domain Facet elements in the mesh. + +```fortran +CALL Display( obj%getTotalDomainFacetElements(), & + & "getTotalDomainFacetElements=") +``` + +Getting the master cell number of an domain facet element. + +```fortran +DO iel = 1, obj%getTotalDomainFacetElements() + ii = obj%getMasterCellNumber( facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT ) + CALL Display( ii, "masterCell( " // tostring( iel ) // " ) = " ) +END DO +``` + +Getting the `masterLocalFacetID` of an domain facet element. + +```fortran +DO iel = 1, obj%getTotalDomainFacetElements() + ii = obj%getMasterCellNumber( facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT ) + !! + CALL Display( obj%getConnectivity( globalElement=ii ), & + & "cellNptrs = " ) + !! + CALL Display( obj%getFacetConnectivity( facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT, & + & isMaster=.TRUE. ), "facetNptrs=" ) + !! + CALL Display( obj%getLocalFacetID( & + & facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT, & + & isMaster = .TRUE. ), & + & "masterLocalFacetID( " // tostring( iel ) // " ) = " ) +END DO +``` + +Getting the slave number of an internal facet element. `DomainFacetElement` does not have a slave. + +```fortran + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_FacetElement_test_6.md b/docs/docs-api/FEMesh/examples/_FacetElement_test_6.md new file mode 100644 index 000000000..b2486fe1b --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_FacetElement_test_6.md @@ -0,0 +1,77 @@ +This example shows the use of methods for getting information of `domainFacetData`. + +Domain facet elements have `DOMAIN_BOUNDARY_ELEMENT` type. + +In this example we do create an instance of [[Domain_]], therefore, +we build the information about `DOMAIN_BOUNDARY_ELEMENT` (`domainFacetData`) and `BOUNDARY_ELEMENT` (`meshFacetData`). + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + CLASS( Mesh_ ), POINTER :: obj + TYPE( Domain_ ) :: dom + TYPE( HDF5File_ ) :: domainFile + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" +``` + +Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + +```fortran +CALL domainFile%Initiate( FileName=filename, MODE="READ" ) +CALL domainFile%Open() +CALL dom%Initiate(hdf5=domainFile, group="" ) +obj => dom%getMeshPointer(dim=dom%getNSD(), entityNum=1) +``` + +Getting the total number of Domain Facet elements in the mesh. + +```fortran +CALL Display( obj%getTotalDomainFacetElements(), & + & "getTotalDomainFacetElements=") +``` + +Getting the master cell number of an domain facet element. + +```fortran +DO iel = 1, obj%getTotalDomainFacetElements() + ii = obj%getMasterCellNumber( & + & facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT ) + CALL Display( ii, "masterCell( " // tostring( iel ) // " ) = " ) +END DO +``` + +Getting the `masterLocalFacetID` of an domain facet element. + +```fortran +DO iel = 1, obj%getTotalDomainFacetElements() + ii = obj%getMasterCellNumber( facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT ) + !! + CALL Display( obj%getConnectivity( globalElement=ii ), & + & "cellNptrs = " ) + !! + CALL Display( obj%getFacetConnectivity( facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT, & + & isMaster=.TRUE. ), "facetNptrs=" ) + !! + CALL Display( obj%getLocalFacetID( & + & facetElement=iel, & + & elementType=DOMAIN_BOUNDARY_ELEMENT, & + & isMaster = .TRUE. ), & + & "masterLocalFacetID( " // tostring( iel ) // " ) = " ) +END DO +``` + +Getting the slave number of an internal facet element. `DomainFacetElement` does not have a slave. + +```fortran + NULLIFY( obj ) + CALL dom%Deallocate() + CALL domainFile%Close() + CALL domainFile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_FacetElement_test_7.md b/docs/docs-api/FEMesh/examples/_FacetElement_test_7.md new file mode 100644 index 000000000..bad6d13f1 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_FacetElement_test_7.md @@ -0,0 +1,88 @@ +This example demonstrate methods for getting information of `meshFacetData`. mesh facet elements have `BOUNDARY_ELEMENT` type. + +In this example we do create an instance of [[Domain_]], therefore, +we build the information about `DOMAIN_BOUNDARY_ELEMENT` (`domainFacetData`) and `BOUNDARY_ELEMENT` (`meshFacetData`). + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + CLASS( Mesh_ ), POINTER :: obj + TYPE( Domain_ ) :: dom + TYPE( HDF5File_ ) :: domainFile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" +``` + +Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + +```fortran +CALL domainFile%Initiate( FileName=filename, MODE="READ" ) +CALL domainFile%Open() +CALL dom%Initiate(hdf5=domainFile, group="" ) +obj => dom%getMeshPointer(dim=dom%getNSD(), entityNum=1) +``` + +Getting the total number of `meshFacetElement` + +```fortran +CALL Display( obj%getTotalMeshFacetElements(), & + & "getTotalMeshFacetElements=") +``` + +Getting the master cell number of an mesh facet element. Getting the `masterLocalFacetID` of an mesh facet element. + +```fortran +DO iel = 1, obj%getTotalMeshFacetElements() + !! + ii = obj%getMasterCellNumber( facetElement=iel, & + & elementType=BOUNDARY_ELEMENT, & + & facetBoundary=1 ) + !! + CALL Display( obj%getConnectivity( globalElement=ii ), & + & "cellNptrs = " ) + !! + CALL Display( obj%getFacetConnectivity( facetElement=iel, & + & elementType=BOUNDARY_ELEMENT, & + & isMaster=.TRUE., & + & facetBoundary=1 ), "facetNptrs=" ) + !! + CALL Display( obj%getLocalFacetID( & + & facetElement=iel, & + & elementType=BOUNDARY_ELEMENT, & + & isMaster = .TRUE., & + & facetBoundary=1 ), & + & "masterLocalFacetID( " // tostring( iel ) // " ) = " ) +END DO +``` + +Getting the slave cell number of an mesh facet element. Getting the `masterLocalFacetID` of an mesh facet element. + +```fortran +CALL Display( "== SlaveCell== " ) +DO iel = 1, obj%getTotalMeshFacetElements() + !! + ii = obj%getSlaveCellNumber( facetElement=iel, & + & elementType=BOUNDARY_ELEMENT, & + & facetBoundary=1 ) + !! + CALL Display( ii, "getSlaveCellNumber = " ) + !! + CALL Display( obj%getLocalFacetID( & + & facetElement=iel, & + & elementType=BOUNDARY_ELEMENT, & + & isMaster = .FALSE., & + & facetBoundary=1 ), & + & "slaveLocalFacetID( " // tostring( iel ) // " ) = " ) +END DO +``` + +```fortran + NULLIFY( obj ) + CALL dom%Deallocate() + CALL domainFile%Close() + CALL domainFile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetBoundaryElementData_test_1.md b/docs/docs-api/FEMesh/examples/_GetBoundaryElementData_test_1.md new file mode 100644 index 000000000..b3ba1f30c --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetBoundaryElementData_test_1.md @@ -0,0 +1,37 @@ +This example shows how to get the boundary data in the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + + CALL meshfile%Initiate( FileName="./mesh.h5", MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Now we get the boundary element data. + ! Element number 515 is a boundary element, and one of its face concides + ! with the mesh boundary. + + CALL Display( obj%getConnectivity( 515 ), "cellNptrs=" ) + nptrs = obj%GetBoundaryElementData( globalElement=515 ) + CALL Display( nptrs, "Boundary element data for 515=") + + ! Now we get the boundary element data. + ! Element number 316 is a boundary element, and one of its face concides with the mesh boundary. + + CALL Display( obj%getConnectivity( 316 ), "cellNptrs=" ) + nptrs = obj%GetBoundaryElementData( globalElement=316 ) + CALL Display( nptrs, "Boundary element data for 316=") + + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetBoundingBox_test_2.md b/docs/docs-api/FEMesh/examples/_GetBoundingBox_test_2.md new file mode 100644 index 000000000..52606d724 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetBoundingBox_test_2.md @@ -0,0 +1,49 @@ +This example shows how to get the bounding box of the mesh. + +In the previous example, we do not specify the nodal coordinates. + +However, in this case we specify the nodal coordinates + +:::note +It is often the case when the mesh coordinates are changing during the simulation. +::: + +## Usage + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + TYPE( Domain_ ) :: dom + TYPE( BoundingBox_ ) :: box + REAL( DFP ), POINTER :: nodeCoord( :, : ) + INTEGER( I4B ), POINTER :: local_nptrs( : ) + + ! Open the mesh file which is [[HDF5File_]] format. + + CALL meshfile%Initiate( FileName="./mesh.h5", MODE="READ" ) + CALL meshfile%Open() + + ! Initiate an instance of [[Mesh_]] and [[Domain_]] by reading the mesh file. + + CALL dom%Initiate(hdf5=meshfile, group="" ) + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Get the pointer to nodal coordinates from the [[Domain_]] + + nodeCoord => dom%GetNodeCoordPointer() + local_nptrs => dom%GetGlobalToLocalNodeNumPointer() + + ! Get the bounding box of the mesh by specifying the nodal coordinates and local nptrs. + + box = obj%GetBoundingBox(nodes=nodeCoord, local_nptrs=local_nptrs ) + CALL Display( box, "" ) + + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetBounding_test_1.md b/docs/docs-api/FEMesh/examples/_GetBounding_test_1.md new file mode 100644 index 000000000..03c8bd2de --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetBounding_test_1.md @@ -0,0 +1,33 @@ +This example shows how to get the bounding box of the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + TYPE( BoundingBox_ ) :: box + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. + ! Then initiate an instance of the [[Mesh_]]. + CALL meshfile%Initiate( FileName="./mesh.h5", MODE="READ" ) + CALL meshfile%Open() + + ! Getting the bounding box of the mesh of 2d elements. + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + box = obj%GetBoundingBox() + CALL Display( box, "" ) + CALL obj%Deallocate() + + ! Getting the bounding box of the mesh of 1d elements. + + CALL obj%Initiate(hdf5=meshfile, group="/curveEntities_1" ) + box = obj%GetBoundingBox() + CALL Display( box, "" ) + CALL obj%Deallocate() + + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetElementToElements_test_1.md b/docs/docs-api/FEMesh/examples/_GetElementToElements_test_1.md new file mode 100644 index 000000000..b0aeb1064 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetElementToElements_test_1.md @@ -0,0 +1,57 @@ +This example shows how to get the element to element connectivity data in the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( :, : ) + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + +CALL meshfile%Initiate( FileName="./mesh.h5", MODE="READ" ) +CALL meshfile%Open() +CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) +``` + +! Now we get the full information about the element connected to the given global element numbers. +! In this case we set `onlyElements=.FALSE.`, +! or you can ignore this argument as it is optional, with default value of `.FALSE.`. + +```fortran +nptrs = obj%GetElementToElements( globalElement=250, onlyElements=.FALSE. ) +CALL Display( nptrs, "Element connected to iel=250") +``` + +We get the following output. + +| global Element number of neighbour | facet number of parent | facet number of neighbour | +| ---------------------------------- | ---------------------- | ------------------------- | +| 352 | 1 | 3 | +| 221 | 2 | 3 | +| 229 | 3 | 2 | + +- The first column is the global element number of neighbour. +- The second column is the local facet number of the parent (iel=250) +- The third column is the local facet number of neighbour + +If you only want the global element numbers of the neighbours, then you can set onlyElements=.TRUE. + +```fortran +nptrs = obj%GetElementToElements( globalElement=250, onlyElements=.TRUE. ) +CALL Display( nptrs, "Element connected to iel=250") +``` + +Now we get the full information about the element connected to the given global element numbers. + +```fortran +nptrs = obj%GetElementToElements( globalElement=316, onlyElements=.FALSE. ) +CALL Display( nptrs, "Element connected to iel=316") + + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetElementToElements_test_2.md b/docs/docs-api/FEMesh/examples/_GetElementToElements_test_2.md new file mode 100644 index 000000000..a3014a2a3 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetElementToElements_test_2.md @@ -0,0 +1,31 @@ +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh.h5" + + CALL meshfile%Initiate( filename, "READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Now we get the full information about the element + ! connected to the given global element numbers. + +block + nptrs = obj%GetElementToElements( globalElement=250, onlyElements=.TRUE. ) +end block + + nptrs = obj%GetElementToElements( globalElement=250, onlyElements=.TRUE. ) + CALL Display( nptrs, "Element connected to iel=250") + + nptrs = obj%GetElementToElements( globalElement=316, onlyElements=.FALSE. ) + CALL Display( nptrs, "Element connected to iel=316") + + CALL obj%Deallocate() + CALL meshfile%Close() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetMaxNNE_test_1.md b/docs/docs-api/FEMesh/examples/_GetMaxNNE_test_1.md new file mode 100644 index 000000000..b687c7205 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetMaxNNE_test_1.md @@ -0,0 +1,30 @@ +--- +title: FEMesh GetMaxNNE Example 1 +--- + +This example tests the `GetMaxNNE` method, which returns the total number of +nodes in an element. + +The element number should be global element number. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh_two_region.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, dim=2) + + + CALL OK(obj%GetMaxNNE() .EQ. 4_I4B, "NNE: ") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetMaxNNE_test_2.md b/docs/docs-api/FEMesh/examples/_GetMaxNNE_test_2.md new file mode 100644 index 000000000..aae6927bb --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetMaxNNE_test_2.md @@ -0,0 +1,26 @@ +--- +title: FEMesh GetMaxNNE Example 2 +--- + +Testing `GetMaxNNE` for old style mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + CALL OK(obj%GetMaxNNE( ) .EQ. 3_I4B, "GetMaxNNE: ") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNNE_test_1.md b/docs/docs-api/FEMesh/examples/_GetNNE_test_1.md new file mode 100644 index 000000000..69000f6bd --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNNE_test_1.md @@ -0,0 +1,29 @@ +--- +title: FEMesh GetNNE Example 1 +--- + +This example tests the `GetNNE` method, which returns the total number of nodes in an element. + +The element number should be global element number. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh_two_region.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, dim=2) + + + CALL OK(obj%GetNNE( obj%GetGlobalElemNumber(1) ) .EQ. 4_I4B, "NNE: ") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNNE_test_2.md b/docs/docs-api/FEMesh/examples/_GetNNE_test_2.md new file mode 100644 index 000000000..27d7f3285 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNNE_test_2.md @@ -0,0 +1,26 @@ +--- +title: FEMesh GetNNE Example 2 +--- + +Testing `GetNNE` for old style mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + CALL OK(obj%GetNNE( obj%GetGlobalElemNumber(1) ) .EQ. 3_I4B, "NNE: ") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNodeConnectivity_test_1.md b/docs/docs-api/FEMesh/examples/_GetNodeConnectivity_test_1.md new file mode 100644 index 000000000..335295207 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNodeConnectivity_test_1.md @@ -0,0 +1,25 @@ +This example shows how to initiate an instance of `Mesh_` by reading data from mesh file, which is in `HDF5File_` format. + +```fortran +PROGRAM main +USE easifemBase +USE easifemClasses +IMPLICIT NONE +TYPE(Mesh_) :: obj +TYPE(HDF5File_) :: meshfile +CHARACTER(LEN=*), PARAMETER :: filename = "./mesh.h5" +INTEGER(I4B), ALLOCATABLE :: edge_connectivity(:, :) +! Initiate and open the mesh file which is in `HDF5File_` format. +CALL meshfile%Initiate(FileName=filename, MODE="READ") +! Open the mesh file +CALL meshfile%OPEN() +! Initiate an instance of `Mesh_` +CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1") +CALL Reallocate(edge_connectivity, obj%GetMaxNNE(), obj%GetTotalElements()) +CALL obj%GetNodeConnectivity(edge_connectivity) +CALL Display(edge_connectivity, "edge_connectivity") +! Display the content of mesh. +CALL obj%DEALLOCATE() +CALL meshfile%DEALLOCATE() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNodeToElements_test_1.md b/docs/docs-api/FEMesh/examples/_GetNodeToElements_test_1.md new file mode 100644 index 000000000..156e142a6 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNodeToElements_test_1.md @@ -0,0 +1,52 @@ +--- +title: "FEMesh GetNodeToElements Example 1" +--- + +This example shows how to get the node to element connectivity data in the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate dynamic data structure + CALL obj%InitiateNodeToElements() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + ! Display the mesh data + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode = 10 + + ans = obj%GetNodeToElements(globalNode) + ans = sort(ans) + exact_ans = [14, 15, 22, 23, 24, 25] + CALL OK(ALL(exact_ans .eq. ans), "GetNodeToElements: " ) + end block + + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode = 5 + + ans = obj%GetNodeToElements(globalNode) + ans = sort(ans) + exact_ans = [15, 17, 24] + CALL OK(ALL(exact_ans .eq. ans), "GetNodeToElements: " ) + end block + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNodeToElements_test_2.md b/docs/docs-api/FEMesh/examples/_GetNodeToElements_test_2.md new file mode 100644 index 000000000..9d45c6420 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNodeToElements_test_2.md @@ -0,0 +1,52 @@ +--- +title: "FEMesh GetNodeToElements Example 2" +--- + +This example shows how to get the node to element connectivity data in the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh_two_region.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, dim=2) + ! Initiate dynamic data structure + CALL obj%InitiateNodeToElements() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + ! Display the mesh data + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode = 2 + + ans = obj%GetNodeToElements(globalNode) + ans = sort(ans) + exact_ans = [19, 20] + CALL OK(ALL(exact_ans .eq. ans), "GetNodeToElements: " ) + end block + + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode = 1 + + ans = obj%GetNodeToElements(globalNode) + ans = sort(ans) + exact_ans = [18] + CALL OK(ALL(exact_ans .eq. ans), "GetNodeToElements: " ) + end block + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_1.md b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_1.md new file mode 100644 index 000000000..1f4c0cfe6 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_1.md @@ -0,0 +1,64 @@ +--- +title: "FE Mesh GetNodeToNodes example 1" +--- + +This example shows how to get the node to node connectivity data in the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate node to nodes + CALL obj%InitiateNodeToNodes() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + ! Display the mesh data + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + ans = obj%GetNodeToNodes(globalNode=10, includeSelf=.TRUE.) + ans = SORT(ans) + exact_ans = [1, 5, 8, 9, 10, 11, 12] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + ans = obj%GetNodeToNodes(globalNode=10, includeSelf=.FALSE.) + ans = SORT(ans) + exact_ans = [1, 5, 8, 9, 11, 12] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + ans = obj%GetNodeToNodes(globalNode=5, includeSelf=.TRUE.) + ans = SORT(ans) + exact_ans = [1, 2, 5, 10, 12] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + ans = obj%GetNodeToNodes(globalNode=5, includeSelf=.FALSE.) + ans = SORT(ans) + exact_ans = [1, 2, 10, 12] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_2.md b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_2.md new file mode 100644 index 000000000..ee93d7420 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_2.md @@ -0,0 +1,68 @@ +--- +title: "FE Mesh GetNodeToNodes example 2" +--- + +This example shows how to get the node to node connectivity data in the mesh. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh_two_region.h5" + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, dim=2) + ! Initiate node to nodes + CALL obj%InitiateNodeToNodes() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + ! Display the mesh data + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode=2 + ans = obj%GetNodeToNodes(globalNode=globalNode, includeSelf=.TRUE.) + ans = SORT(ans) + exact_ans = [2, 5, 7, 8, 9, 10] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode=2 + ans = obj%GetNodeToNodes(globalNode=globalNode, includeSelf=.FALSE.) + ans = SORT(ans) + exact_ans = [5, 7, 8, 9, 10] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode=1 + ans = obj%GetNodeToNodes(globalNode=globalNode, includeSelf=.TRUE.) + ans = SORT(ans) + exact_ans = [1, 4, 7, 9] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + block + INTEGER( I4B ), ALlOCATABLE :: ans(:), exact_ans(:) + INTEGER( I4B ), PARAMETER :: globalNode=1 + ans = obj%GetNodeToNodes(globalNode=globalNode, includeSelf=.FALSE.) + ans = SORT(ans) + exact_ans = [4, 7, 9] + CALL OK( ALL(ans .eq. exact_ans), "GetNodeToNodes: ") + end block + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_20.md b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_20.md new file mode 100644 index 000000000..e830526df --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_20.md @@ -0,0 +1,39 @@ +This example shows how to use get node to node data for edge-based stabilized FEM. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: n2n( : ), e2e( :, : ), n2e( : ), nptrs( : ), & + & extranptrs( : ), indx( : ) + INTEGER( I4B ) :: iel, ii, iel2 + LOGICAL( LGT ), ALLOCATABLE :: mask_elem( : ), mask_nptrs( : ) + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Get node to node data for node number 10 + n2n = obj%getNodeToNodes( globalNode=10, IncludeSelf=.FALSE. ) + CALL Display( n2n, "node-to-nodes[10] = " ) + + ! Get node to node data for node number 11 + n2n = obj%getNodeToNodes( globalNode=11, IncludeSelf=.FALSE. ) + CALL Display( n2n, "node-to-nodes[11] = " ) + + ! Get node to node data for node number 9 + n2n = obj%getNodeToNodes( globalNode=9, IncludeSelf=.FALSE. ) + CALL Display( n2n, "node-to-nodes[9] = " ) + + ! Get node to node data for node number 4 + n2n = obj%getNodeToNodes( globalNode=4, IncludeSelf=.FALSE. ) + CALL Display( n2n, "node-to-nodes[4] = " ) + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_30.md b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_30.md new file mode 100644 index 000000000..df410a09a --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_GetNodeToNodes_test_30.md @@ -0,0 +1,47 @@ +This example shows how to use get node to node data for edge-based stabilized FEM. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: n2n( : ), e2e( :, : ), n2e( : ), nptrs( : ), & + & extranptrs( : ), indx( : ) + INTEGER( I4B ) :: iel, ii, iel2 + LOGICAL( LGT ), ALLOCATABLE :: mask_elem( : ), mask_nptrs( : ) + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Get node to node data for node number 10 + n2n = obj%getNodeToNodes( globalNode=10, IncludeSelf=.FALSE. ) + CALL Display( n2n, "node-to-nodes[10] = " ) + n2e = obj%getNodeToElements( globalNode=10 ) + CALL Display( n2e, "node-to-elements[10] = ") + !! + DO iel = 1, SIZE(n2e) + e2e = obj%getElementToElements( globalElement=n2e( iel ), & + & onlyElements=.TRUE. ) + CALL Display( e2e, "element-to-elements( " // tostring( n2e( iel ) ) // " ) = " ) + !! + mask_elem = .NOT. (e2e( :, 1 ) .ISIN. n2e) + !! + DO iel2 = 1, SIZE( mask_elem ) + IF( mask_elem( iel2 ) ) THEN + indx = obj%getConnectivity( globalElement=e2e(iel2, 1) ) + CALL Display( indx, "nptrs ( " // tostring(e2e(iel2, 1)) // " ) = " ) + mask_nptrs = .NOT. ( indx .ISIN. n2n ) + CALL APPEND( extranptrs, indx, mask_nptrs ) + CALL Display( extranptrs, " extranptrs = " ) + END IF + END DO + END DO + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateEdgeConnectivity_test_1.md b/docs/docs-api/FEMesh/examples/_InitiateEdgeConnectivity_test_1.md new file mode 100644 index 000000000..b7263ed67 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateEdgeConnectivity_test_1.md @@ -0,0 +1,34 @@ +In this example we show the usage of `InitiateEdgeConnectivity` method. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh.h5" + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateEdgeConnectivity() + + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + + CALL obj%DisplayElementData("ElementData:") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateElemSD_test_1.md b/docs/docs-api/FEMesh/examples/_InitiateElemSD_test_1.md new file mode 100644 index 000000000..1e05d7fe5 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateElemSD_test_1.md @@ -0,0 +1,30 @@ +This example shows how to use `InitiateElemSD` method to initiate element shape data. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./meshdata/small_mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + CALL obj%InitiateElemSD( orderSpace=1, linSpaceElem=obj%refelem, & + & spaceElem=obj%refelem, & + & quadTypeForSpace = "GaussLegendre", & + & continuityTypeForSpace = "H1", & + & interpolTypeForSpace = "LagrangeInterpolation" ) + + CALL Display( obj%spaceElemSD, "spaceElemSD=" ) + CALL Display( "OK" ) + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateElemSD_test_2.md b/docs/docs-api/FEMesh/examples/_InitiateElemSD_test_2.md new file mode 100644 index 000000000..6ce7360b4 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateElemSD_test_2.md @@ -0,0 +1,30 @@ +This example shows how to use `InitiateElemSD` method to initiate element shape data for space-time FEM. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + CALL obj%InitiateElemSD( orderSpace=1, linSpaceElem=obj%refelem, & + & spaceElem=obj%refelem, & + & quadTypeForSpace = "GaussLegendre", & + & continuityTypeForSpace = "H1", & + & interpolTypeForSpace = "LagrangeInterpolation" ) + + CALL Display( obj%spaceElemSD, "spaceElemSD=" ) + CALL Display( "OK" ) + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateElementToElements_test_1.md b/docs/docs-api/FEMesh/examples/_InitiateElementToElements_test_1.md new file mode 100644 index 000000000..3feaef372 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateElementToElements_test_1.md @@ -0,0 +1,34 @@ +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh.h5" + + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateEdgeConnectivity() + + ! Initiate Element to Element data + CALL obj%InitiateElementToElements() + + !Display the content of mesh. + CALL obj%DisplayElementData("ElementData:") + + CALL obj%DisplayMeshInfo(filename) + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_1.md b/docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_1.md new file mode 100644 index 000000000..f30c4ab9f --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_1.md @@ -0,0 +1,38 @@ +--- +title: InitiateFaceConnectivity example 1 +--- + +In this example we show the usage of `InitiateFaceConnectivity` method. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh_3d.h5" + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/volumeEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateFaceConnectivity() + + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + + CALL obj%DisplayElementData("ElementData:") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_2.md b/docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_2.md new file mode 100644 index 000000000..a4ab1cc22 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateFaceConnectivity_test_2.md @@ -0,0 +1,43 @@ +--- +title: InitiateFaceConnectivity example 2 +--- + +In this example we show the usage of `InitiateFaceConnectivity` method. We test its accuracy also. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh_3d.h5" + INTEGER(I4B) :: iel, globalFaceCon(4, 4) + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/volumeEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateFaceConnectivity() + + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + + CALL obj%DisplayElementData("ElementData:") + + DO iel = 1, obj%GetTotalElements() + CALL ElemData_GetGlobalFaceCon(obj%elementData(iel), globalFaceCon ) + END DO + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateFacetElemSD_test_1.md b/docs/docs-api/FEMesh/examples/_InitiateFacetElemSD_test_1.md new file mode 100644 index 000000000..37a5cf788 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateFacetElemSD_test_1.md @@ -0,0 +1,42 @@ +This example shows how to use `InitiateFacetElemSD` method to initiate element shape data on facet elements. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) + INTEGER( I4B ) :: iel, ii + CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + + ! Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + CALL meshfile%Open() + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + ! Initiating the element shape data on cells. + + CALL obj%InitiateElemSD( orderSpace=1, linSpaceElem=obj%refelem, & + & spaceElem=obj%refelem, & + & quadTypeForSpace = "GaussLegendre", & + & continuityTypeForSpace = "H1", & + & interpolTypeForSpace = "LagrangeInterpolation" ) + ! Initiating the element shape data on facet elements. + CALL obj%InitiateFacetElemSD( & + & orderSpace=1, & + & linSpaceElem=obj%facetElements, & + & spaceElem=obj%facetElements, & + & quadTypeForSpace = "GaussLegendre", & + & continuityTypeForSpace = "H1", & + & interpolTypeForSpace = "LagrangeInterpolation" ) + !! + CALL obj%DisplayFacetElemSD( "DisplayFacetElemSD = " ) + !! + CALL obj%DisplayFacetElements( "DisplayFacetElements = " ) + !! + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_1.md b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_1.md new file mode 100644 index 000000000..c8e3b4695 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_1.md @@ -0,0 +1,29 @@ +--- +title: "FEMesh InitiateNodeToElements Example 1" +--- + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate dynamic data structure + CALL obj%InitiateNodeToElements() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + ! Display the mesh data + CALL obj%DisplayNodeData("Node data of " // filename) + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_2.md b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_2.md new file mode 100644 index 000000000..ca2405e1e --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_2.md @@ -0,0 +1,27 @@ +--- +title: "FEMesh InitiateNodeToElements test 2" +--- + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/big_mesh.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate dynamic data structure + CALL obj%InitiateNodeToElements() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_3.md b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_3.md new file mode 100644 index 000000000..1fb00e9ba --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_3.md @@ -0,0 +1,27 @@ +--- +title: "FEMesh InitiateNodeToElements Example 3" +--- + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/big_big_mesh.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate dynamic data structure + CALL obj%InitiateNodeToElements() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_4.md b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_4.md new file mode 100644 index 000000000..5a4c7c752 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateNodeToElements_test_4.md @@ -0,0 +1,29 @@ +--- +title: "FEMesh InitiateNodeToElements Example 4" +--- + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh_two_region.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, dim=2) + ! Initiate dynamic data structure + CALL obj%InitiateNodeToElements() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + ! Display the mesh data + CALL obj%DisplayNodeData("Node data of " // filename) + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_1.md b/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_1.md new file mode 100644 index 000000000..95685d3ff --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_1.md @@ -0,0 +1,29 @@ +--- +title: "FEMesh InitiateNodeToNodes example 1" +--- + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate node to nodes + CALL obj%InitiateNodeToNodes() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + ! Display the mesh data + CALL obj%DisplayNodeData("Node data of " // filename) + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_2.md b/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_2.md new file mode 100644 index 000000000..06a420da5 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_2.md @@ -0,0 +1,27 @@ +--- +title: "FEMesh InitiateNodeToNodes Example 2" +--- + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/big_mesh.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate node to nodes + CALL obj%InitiateNodeToNodes() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_3.md b/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_3.md new file mode 100644 index 000000000..d0289285d --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_InitiateNodeToNodes_test_3.md @@ -0,0 +1,28 @@ +--- +title: "FEMesh InitiateNodeToNodes Example 3" +--- + + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/big_big_mesh.h5" + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + !Open the mesh file + CALL meshfile%Open() + CALL obj%SetShowTime(.true.) + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + ! Initiate node to nodes + CALL obj%InitiateNodeToNodes() + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_Initiate_test_1.md b/docs/docs-api/FEMesh/examples/_Initiate_test_1.md new file mode 100644 index 000000000..4c47b7cda --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_Initiate_test_1.md @@ -0,0 +1,49 @@ +--- +title: Mesh Initiate Example 2 +--- + +This example shows how to initiate an instance of `Mesh_` by reading data +from mesh file, which is in `HDF5File_` format. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh.h5" +``` + +Initiate and open the mesh file which is in `HDF5File_` format. + +```fortran +CALL meshfile%Initiate( FileName=filename, MODE="READ" ) +``` + +Open the mesh file + +```fortran +CALL meshfile%Open() +``` + +Initiate an instance of `Mesh_` + +```fortran +CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) +``` + +Display the content of mesh. + +```fortran +CALL obj%Display("") +``` + +cleaning up. + +```fortran + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_Initiate_test_2.md b/docs/docs-api/FEMesh/examples/_Initiate_test_2.md new file mode 100644 index 000000000..e9b5ba8bb --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_Initiate_test_2.md @@ -0,0 +1,49 @@ +--- +title: BetterMesh Initiate Example 2 +--- + +This example shows how to initiate an instance of `Mesh_` by reading data +from mesh file, which is in `HDF5File_` format. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh_two_region.h5" +``` + +Initiate and open the mesh file which is in `HDF5File_` format. + +```fortran +CALL meshfile%Initiate( FileName=filename, MODE="READ" ) +``` + +Open the mesh file + +```fortran +CALL meshfile%Open() +``` + +Initiate an instance of `Mesh_` + +```fortran +CALL obj%Initiate(hdf5=meshfile, dim=2, entities=[1,2] ) +``` + +Display the content of mesh. + +```comment +CALL obj%Display("") +``` + +cleaning up. + +```fortran + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_Initiate_test_3.md b/docs/docs-api/FEMesh/examples/_Initiate_test_3.md new file mode 100644 index 000000000..e440ce4ac --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_Initiate_test_3.md @@ -0,0 +1,49 @@ +--- +title: BetterMesh Initiate Example 3 +--- + +This example shows how to initiate an instance of `Mesh_` by reading data +from mesh file, which is in `HDF5File_` format. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh_two_region.h5" +``` + +Initiate and open the mesh file which is in `HDF5File_` format. + +```fortran +CALL meshfile%Initiate( FileName=filename, MODE="READ" ) +``` + +Open the mesh file + +```fortran +CALL meshfile%Open() +``` + +Initiate an instance of `Mesh_` + +```fortran +CALL obj%Initiate(hdf5=meshfile, dim=2 ) +``` + +Display the content of mesh. + +```fortran +CALL obj%Display("") +``` + +cleaning up. + +```fortran + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_Initiate_test_4.md b/docs/docs-api/FEMesh/examples/_Initiate_test_4.md new file mode 100644 index 000000000..19ddcb311 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_Initiate_test_4.md @@ -0,0 +1,49 @@ +--- +title: BetterMesh Initiate Example 3 +--- + +This example shows how to initiate an instance of `Mesh_` by reading data +from mesh file, which is in `HDF5File_` format. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh_3d_two_region.h5" +``` + +Initiate and open the mesh file which is in `HDF5File_` format. + +```fortran +CALL meshfile%Initiate( FileName=filename, MODE="READ" ) +``` + +Open the mesh file + +```fortran +CALL meshfile%Open() +``` + +Initiate an instance of `Mesh_` + +```fortran +CALL obj%Initiate(hdf5=meshfile, dim=3 ) +``` + +Display the content of mesh. + +```fortran +CALL obj%Display("") +``` + +cleaning up. + +```fortran + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/examples/_Initiate_test_5.md b/docs/docs-api/FEMesh/examples/_Initiate_test_5.md new file mode 100644 index 000000000..957373cf4 --- /dev/null +++ b/docs/docs-api/FEMesh/examples/_Initiate_test_5.md @@ -0,0 +1,49 @@ +--- +title: BetterMesh Initiate Example 3 +--- + +This example shows how to initiate an instance of `Mesh_` by reading data +from mesh file, which is in `HDF5File_` format. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( FEMesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER( LEN = *), PARAMETER :: filename= & + & "../../Mesh/examples/meshdata/small_mesh_3d_two_region.h5" +``` + +Initiate and open the mesh file which is in `HDF5File_` format. + +```fortran +CALL meshfile%Initiate( FileName=filename, MODE="READ" ) +``` + +Open the mesh file + +```fortran +CALL meshfile%Open() +``` + +Initiate an instance of `Mesh_` + +```fortran +CALL obj%Initiate(hdf5=meshfile, dim=2, entities =[1, 2, 3, 4, 5, 7, 8, 9, 10, 11] ) +``` + +Display the content of mesh. + +```fortran +CALL obj%Display("") +``` + +cleaning up. + +```fortran + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/FEMesh/index.md b/docs/docs-api/FEMesh/index.md new file mode 100644 index 000000000..55c04cd88 --- /dev/null +++ b/docs/docs-api/FEMesh/index.md @@ -0,0 +1,26 @@ +--- +sidebar_position: 1 +date: 2024-03-19 +update: 2024-03-19 +status: stable +docs: done +extpkgs: none +category: + - Domain + - Mesh +tags: + - Domain + - Mesh +--- + +# FEMesh + +`FEMesh_` datatype handles the finite element mesh. + +- You can learn about the structure of `Mesh` [Here](./FEMesh_.md) + +## All methods + +import DocCardList from '@theme/DocCardList'; + + diff --git a/docs/docs-api/Mesh/examples/_DisplayElementData_test_1.md b/docs/docs-api/Mesh/examples/_DisplayElementData_test_1.md index 8a394bafc..b3f0417aa 100644 --- a/docs/docs-api/Mesh/examples/_DisplayElementData_test_1.md +++ b/docs/docs-api/Mesh/examples/_DisplayElementData_test_1.md @@ -9,10 +9,11 @@ PROGRAM main TYPE( HDF5File_ ) :: meshfile INTEGER( I4B ), ALLOCATABLE :: nptrs( : ) INTEGER( I4B ) :: iel, ii - CHARACTER( LEN=* ), PARAMETER :: filename="./mesh.h5" + CHARACTER( LEN=* ), PARAMETER :: filename="./meshdata/small_mesh.h5" ``` -Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. +Initiate and open the mesh file which is in HDF5File format. +Then, create an instance of mesh. ```fortran CALL meshfile%Initiate( FileName=filename, MODE="READ" ) diff --git a/docs/docs-api/Mesh/examples/_InitiateEdgeConnectivity_test_1.md b/docs/docs-api/Mesh/examples/_InitiateEdgeConnectivity_test_1.md new file mode 100644 index 000000000..91f51ac80 --- /dev/null +++ b/docs/docs-api/Mesh/examples/_InitiateEdgeConnectivity_test_1.md @@ -0,0 +1,34 @@ +In this example we show the usage of `InitiateEdgeConnectivity` method. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh.h5" + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateEdgeConnectivity() + + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + + CALL obj%DisplayElementData("ElementData:") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Mesh/examples/_InitiateElementToElements_test_1.md b/docs/docs-api/Mesh/examples/_InitiateElementToElements_test_1.md new file mode 100644 index 000000000..76a85a145 --- /dev/null +++ b/docs/docs-api/Mesh/examples/_InitiateElementToElements_test_1.md @@ -0,0 +1,34 @@ +In this example we show the usage of `InitiateElementToElements` method. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh.h5" + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateEdgeConnectivity() + + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + + CALL obj%DisplayElementData("ElementData:") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_1.md b/docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_1.md new file mode 100644 index 000000000..f30c4ab9f --- /dev/null +++ b/docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_1.md @@ -0,0 +1,38 @@ +--- +title: InitiateFaceConnectivity example 1 +--- + +In this example we show the usage of `InitiateFaceConnectivity` method. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh_3d.h5" + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/volumeEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateFaceConnectivity() + + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + + CALL obj%DisplayElementData("ElementData:") + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_2.md b/docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_2.md new file mode 100644 index 000000000..a4ab1cc22 --- /dev/null +++ b/docs/docs-api/Mesh/examples/_InitiateFaceConnectivity_test_2.md @@ -0,0 +1,43 @@ +--- +title: InitiateFaceConnectivity example 2 +--- + +In this example we show the usage of `InitiateFaceConnectivity` method. We test its accuracy also. + +```fortran +PROGRAM main + USE easifemBase + USE easifemClasses + IMPLICIT NONE + TYPE( Mesh_ ) :: obj + TYPE( HDF5File_ ) :: meshfile + CHARACTER(*), PARAMETER :: filename="./meshdata/small_mesh_3d.h5" + INTEGER(I4B) :: iel, globalFaceCon(4, 4) + + CALL e%SetQuietMode(.TRUE.) + CALL meshfile%Initiate( FileName=filename, MODE="READ" ) + + !Open the mesh file + CALL meshfile%Open() + + CALL obj%SetShowTime(.TRUE.) + + !Initiate an instance of `Mesh_` + CALL obj%Initiate(hdf5=meshfile, group="/volumeEntities_1" ) + + !Initiate an edge connectivity + CALL obj%InitiateFaceConnectivity() + + !Display the content of mesh. + CALL obj%DisplayMeshInfo(filename) + + CALL obj%DisplayElementData("ElementData:") + + DO iel = 1, obj%GetTotalElements() + CALL ElemData_GetGlobalFaceCon(obj%elementData(iel), globalFaceCon ) + END DO + + CALL obj%Deallocate() + CALL meshfile%Deallocate() +END PROGRAM main +``` diff --git a/docs/docs-api/Mesh/examples/_Initiate_test_1.md b/docs/docs-api/Mesh/examples/_Initiate_test_1.md index da9a28c7f..ade5fe72c 100644 --- a/docs/docs-api/Mesh/examples/_Initiate_test_1.md +++ b/docs/docs-api/Mesh/examples/_Initiate_test_1.md @@ -1,4 +1,5 @@ -This example shows how to convert the mesh generated from Gmsh, `MSHFile_` format into the `HDF5File_` format. +This example shows how to convert the mesh generated from `Gmsh` +`MSHFile_` format into the `HDF5File_` format. ```fortran PROGRAM main @@ -12,7 +13,8 @@ PROGRAM main Initiate an instance of `MSHFile_` which is created by Gmsh ```fortran -CALL mshFile%Initiate( filename="./meshdata/small_mesh.msh", STATUS="OLD", ACTION="READ" ) +CALL mshFile%Initiate( filename="./meshdata/small_mesh.msh", & +& STATUS="OLD", ACTION="READ" ) ``` Open the mesh file. @@ -39,7 +41,7 @@ Open the `HDF5File_` file so that we can write mesh data in this file. CALL hdf5file%Open() ``` -exporting mesh from `MSHFile` file to `HDF5File`. +Exporting mesh from `MSHFile` file to `HDF5File`. ```fortran CALL mshFile%Export( hdf5=hdf5file, group="" ) diff --git a/docs/docs-api/Mesh/examples/_Initiate_test_2.md b/docs/docs-api/Mesh/examples/_Initiate_test_2.md index 5710201bc..821ea193a 100644 --- a/docs/docs-api/Mesh/examples/_Initiate_test_2.md +++ b/docs/docs-api/Mesh/examples/_Initiate_test_2.md @@ -1,4 +1,9 @@ -This example shows how to initiate an instance of `Mesh_` by reading data from mesh file, which is in `HDF5File_` format. +--- +title: Mesh Initiate Example 2 +--- + +This example shows how to initiate an instance of `Mesh_` by reading data +from mesh file, which is in `HDF5File_` format. ```fortran PROGRAM main diff --git a/docs/docs-api/Mesh/examples/_Initiate_test_3.md b/docs/docs-api/Mesh/examples/_Initiate_test_3.md index bb9b49c1a..cbeb00784 100644 --- a/docs/docs-api/Mesh/examples/_Initiate_test_3.md +++ b/docs/docs-api/Mesh/examples/_Initiate_test_3.md @@ -1,10 +1,12 @@ -This example shows how to initiate an instance of `Mesh_` by reading data from mesh file, which is in `HDF5File_` format. +--- +title: Mesh Initiate Example 3 +--- -This example is same as the previous example (example 2), but in this example we construct `surfaceEntities_2`. +This example shows how to initiate an instance of `Mesh_` +by reading data from mesh file, which is in `HDF5File_` format. -The mesh is given below - -![](../figures/mesh.png) +This example is same as the previous example (example 2), +but in this example we construct `surfaceEntities_2`. ```fortran PROGRAM main @@ -14,7 +16,7 @@ PROGRAM main TYPE( Mesh_ ) :: obj TYPE( HDF5File_ ) :: meshfile - CALL meshfile%Initiate( FileName="./meshdata/small_mesh.h5", MODE="READ" ) + CALL meshfile%Initiate( fileName="./meshdata/small_mesh_two_region.h5", MODE="READ" ) CALL meshfile%Open() CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_2" ) diff --git a/docs/docs-api/ReferenceElement/ElementTopology.md b/docs/docs-api/ReferenceElement/ElementTopology.md index 990caf69b..f89126af5 100644 --- a/docs/docs-api/ReferenceElement/ElementTopology.md +++ b/docs/docs-api/ReferenceElement/ElementTopology.md @@ -8,19 +8,19 @@ This routine returns the topology of the reference element - Tetrahedron ```fortran - MODULE PURE FUNCTION refelem_ElementTopology1(ElemType) RESULT(Ans) - INTEGER(I4B), INTENT(IN) :: ElemType - INTEGER(I4B) :: Ans - END FUNCTION refelem_ElementTopology1 +MODULE PURE FUNCTION refelem_ElementTopology1(ElemType) RESULT(Ans) + INTEGER(I4B), INTENT(IN) :: ElemType + INTEGER(I4B) :: Ans +END FUNCTION refelem_ElementTopology1 ``` ```fortran - MODULE PURE FUNCTION refelem_ElementTopology2(obj) RESULT(Ans) - CLASS(ReferenceElement_), INTENT(IN) :: obj - INTEGER(I4B) :: Ans - END FUNCTION refelem_ElementTopology2 +MODULE PURE FUNCTION refelem_ElementTopology2(obj) RESULT(Ans) + CLASS(ReferenceElement_), INTENT(IN) :: obj + INTEGER(I4B) :: Ans +END FUNCTION refelem_ElementTopology2 ``` :::note -OPERATOR(.topology.) is an alias to ElementTopology. +OPERATOR(.topology.) is an alias to `ElementTopology`. ::: diff --git a/docs/docs-api/ReferenceElement/FacetElements.md b/docs/docs-api/ReferenceElement/FacetElements.md index 9247a8686..55f694e75 100644 --- a/docs/docs-api/ReferenceElement/FacetElements.md +++ b/docs/docs-api/ReferenceElement/FacetElements.md @@ -1,10 +1,30 @@ # FacetElements -This routine returns the facet elements +This routine returns the face elements of a reference element. + +## Interface + + + ```fortran - MODULE PURE FUNCTION RefElem_FacetElements(RefElem) RESULT(ans) - CLASS(ReferenceElement_), INTENT(IN) :: RefElem - TYPE(ReferenceElement_), ALLOCATABLE :: ans(:) - END FUNCTION RefElem_FacetElements +MODULE PURE FUNCTION RefElem_FacetElements(RefElem) RESULT(ans) + CLASS(ReferenceElement_), INTENT(IN) :: RefElem + TYPE(ReferenceElement_), ALLOCATABLE :: ans(:) +END FUNCTION RefElem_FacetElements ``` + + + + + +import EXAMPLE7 from "./examples/_FacetElements_test_1.md"; + + + + + + + + + diff --git a/docs/docs-api/ReferenceElement/ReferenceTopology.md b/docs/docs-api/ReferenceElement/ReferenceTopology.md index 6d41c68bb..f01eda2b6 100644 --- a/docs/docs-api/ReferenceElement/ReferenceTopology.md +++ b/docs/docs-api/ReferenceElement/ReferenceTopology.md @@ -1,9 +1,31 @@ # ReferenceTopology +This method returns the topology of reference element. + +## Interface + + + + ```fortran - MODULE PURE FUNCTION ReferenceTopology(Nptrs, Name) RESULT(obj) - TYPE(ReferenceTopology_) :: obj - INTEGER(I4B), INTENT(IN) :: Nptrs(:) - INTEGER(I4B), INTENT(IN) :: Name - END FUNCTION ReferenceTopology +MODULE PURE FUNCTION ReferenceTopology(nptrs, name) RESULT(obj) + TYPE(ReferenceTopology_) :: obj + INTEGER(I4B), INTENT(IN) :: nptrs(:) + INTEGER(I4B), INTENT(IN) :: name +END FUNCTION ReferenceTopology ``` + + + + + +import EXAMPLE7 from "./examples/_ReferenceTopology_test_1.md"; + + + + + + + + + diff --git a/docs/docs-api/ReferenceElement/examples/_ElementName_test_1.md b/docs/docs-api/ReferenceElement/examples/_ElementName_test_1.md new file mode 100644 index 000000000..1378c560b --- /dev/null +++ b/docs/docs-api/ReferenceElement/examples/_ElementName_test_1.md @@ -0,0 +1,47 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK(ElementName(Line2) .EQ. "Line2", "ElementName: ") +CALL OK(ElementName(Line3) .EQ. "Line3", "ElementName: ") +CALL OK(ElementName(Line4) .EQ. "Line4", "ElementName: ") +CALL OK(ElementName(Line5) .EQ. "Line5", "ElementName: ") +CALL OK(ElementName(Line6) .EQ. "Line6", "ElementName: ") + +CALL OK(ElementName(Triangle3) .EQ. "Triangle3", "ElementName: ") +CALL OK(ElementName(Triangle6) .EQ. "Triangle6", "ElementName: ") +CALL OK(ElementName(Triangle9) .EQ. "Triangle9", "ElementName: ") +CALL OK(ElementName(Triangle10) .EQ. "Triangle10", "ElementName: ") +CALL OK(ElementName(Triangle12) .EQ. "Triangle12", "ElementName: ") +CALL OK(ElementName(Triangle15a) .EQ. "Triangle15a", "ElementName: ") +CALL OK(ElementName(Triangle15b) .EQ. "Triangle15b", "ElementName: ") +CALL OK(ElementName(Triangle21) .EQ. "Triangle21", "ElementName: ") + +CALL OK(ElementName(Quadrangle4) .EQ. "Quadrangle4", "ElementName: ") +CALL OK(ElementName(Quadrangle8) .EQ. "Quadrangle8", "ElementName: ") +CALL OK(ElementName(Quadrangle9) .EQ. "Quadrangle9", "ElementName: ") +CALL OK(ElementName(Quadrangle16) .EQ. "Quadrangle16", "ElementName: ") + +CALL OK(ElementName(Tetrahedron4) .EQ. "Tetrahedron4", "ElementName: ") +CALL OK(ElementName(Tetrahedron10) .EQ. "Tetrahedron10", "ElementName: ") +CALL OK(ElementName(Tetrahedron20) .EQ. "Tetrahedron20", "ElementName: ") +CALL OK(ElementName(Tetrahedron35) .EQ. "Tetrahedron35", "ElementName: ") +CALL OK(ElementName(Tetrahedron56) .EQ. "Tetrahedron56", "ElementName: ") + +CALL OK(ElementName(Hexahedron8) .EQ. "Hexahedron8", "ElementName: ") +CALL OK(ElementName(Hexahedron20) .EQ. "Hexahedron20", "ElementName: ") +CALL OK(ElementName(Hexahedron27) .EQ. "Hexahedron27", "ElementName: ") +CALL OK(ElementName(Hexahedron64) .EQ. "Hexahedron64", "ElementName: ") +CALL OK(ElementName(Hexahedron125) .EQ. "Hexahedron125", "ElementName: ") + +CALL OK(ElementName(Prism6) .EQ. "Prism6", "ElementName: ") +CALL OK(ElementName(Prism15) .EQ. "Prism15", "ElementName: ") +CALL OK(ElementName(Prism18) .EQ. "Prism18", "ElementName: ") + +CALL OK(ElementName(Pyramid5) .EQ. "Pyramid5", "ElementName: ") +CALL OK(ElementName(Pyramid13) .EQ. "Pyramid13", "ElementName: ") +CALL OK(ElementName(Pyramid14) .EQ. "Pyramid14", "ElementName: ") + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceElement/examples/_ElementType_test_1.md b/docs/docs-api/ReferenceElement/examples/_ElementType_test_1.md new file mode 100644 index 000000000..bc3213e4e --- /dev/null +++ b/docs/docs-api/ReferenceElement/examples/_ElementType_test_1.md @@ -0,0 +1,47 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK(ElementType("Line2") .EQ. Line2, "ElementType: ") +CALL OK(ElementType("Line3") .EQ. Line3, "ElementType: ") +CALL OK(ElementType("Line4") .EQ. Line4, "ElementType: ") +CALL OK(ElementType("Line5") .EQ. Line5, "ElementType: ") +CALL OK(ElementType("Line6") .EQ. Line6, "ElementType: ") + +CALL OK(ElementType("Triangle3") .EQ. Triangle3, "ElementType: ") +CALL OK(ElementType("Triangle6") .EQ. Triangle6, "ElementType: ") +CALL OK(ElementType("Triangle9") .EQ. Triangle9, "ElementType: ") +CALL OK(ElementType("Triangle10") .EQ. Triangle10, "ElementType: ") +CALL OK(ElementType("Triangle12") .EQ. Triangle12, "ElementType: ") +CALL OK(ElementType("Triangle15a") .EQ. Triangle15a, "ElementType: ") +CALL OK(ElementType("Triangle15b") .EQ. Triangle15b, "ElementType: ") +CALL OK(ElementType("Triangle21") .EQ. Triangle21, "ElementType: ") + +CALL OK(ElementType("Quadrangle4") .EQ. Quadrangle4, "ElementType: ") +CALL OK(ElementType("Quadrangle8") .EQ. Quadrangle8, "ElementType: ") +CALL OK(ElementType("Quadrangle9") .EQ. Quadrangle9, "ElementType: ") +CALL OK(ElementType("Quadrangle16") .EQ. Quadrangle16, "ElementType: ") + +CALL OK(ElementType("Tetrahedron4") .EQ. Tetrahedron4, "ElementType: ") +CALL OK(ElementType("Tetrahedron10") .EQ. Tetrahedron10, "ElementType: ") +CALL OK(ElementType("Tetrahedron20") .EQ. Tetrahedron20, "ElementType: ") +CALL OK(ElementType("Tetrahedron35") .EQ. Tetrahedron35, "ElementType: ") +CALL OK(ElementType("Tetrahedron56") .EQ. Tetrahedron56, "ElementType: ") + +CALL OK(ElementType("Hexahedron8") .EQ. Hexahedron8, "ElementType: ") +CALL OK(ElementType("Hexahedron20") .EQ. Hexahedron20, "ElementType: ") +CALL OK(ElementType("Hexahedron27") .EQ. Hexahedron27, "ElementType: ") +CALL OK(ElementType("Hexahedron64") .EQ. Hexahedron64, "ElementType: ") +CALL OK(ElementType("Hexahedron125") .EQ. Hexahedron125, "ElementType: ") + +CALL OK(ElementType("Prism6") .EQ. Prism6, "ElementType: ") +CALL OK(ElementType("Prism15") .EQ. Prism15, "ElementType: ") +CALL OK(ElementType("Prism18") .EQ. Prism18, "ElementType: ") + +CALL OK(ElementType("Pyramid5") .EQ. Pyramid5, "ElementType: ") +CALL OK(ElementType("Pyramid13") .EQ. Pyramid13, "ElementType: ") +CALL OK(ElementType("Pyramid14") .EQ. Pyramid14, "ElementType: ") + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_1.md b/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_1.md new file mode 100644 index 000000000..996a8635a --- /dev/null +++ b/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_1.md @@ -0,0 +1,22 @@ +In this example we generate face elements of a +triangle by using the method called `FacetElements`. + +```fortran +PROGRAM main + USE easifemBase + TYPE( ReferenceTriangle_ ) :: obj + TYPE( ReferenceElement_ ) :: facetElems( 3 ) + INTEGER( I4B ) :: ii + + CALL Initiate( obj, nsd = 2 ) + + + CALL GetFacetElements(obj, facetElems) + + DO ii = 1, SIZE( facetElems ) + CALL Display( facetElems( ii ), & + & "facetElements( " // tostring(ii) // " ) = " ) + CALL Blanklines( NOL = 2 ) + END DO +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_2.md b/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_2.md new file mode 100644 index 000000000..6d0396e9d --- /dev/null +++ b/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_2.md @@ -0,0 +1,22 @@ +This example tests the `FacetElements` method. + +```fortran +PROGRAM main + USE easifemBase + + + block + TYPE( ReferenceElement_ ) :: facetElems(3) + INTEGER( I4B ) :: ii + + CALL GetFacetElements(elemType=Triangle3, nsd=2, ans=facetElems) + + DO ii = 1, SIZE( facetElems ) + CALL Display( facetElems( ii ), & + & "facetElements( " // tostring(ii) // " ) = " ) + CALL Blanklines( NOL = 2 ) + END DO + + end block +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_3.md b/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_3.md new file mode 100644 index 000000000..50f8a06f2 --- /dev/null +++ b/docs/docs-api/ReferenceElement/examples/_GetFacetElements_test_3.md @@ -0,0 +1,17 @@ +This example tests the `FacetElements` method. + +```fortran +PROGRAM main + USE easifemBase + TYPE( ReferenceElement_ ) :: facetElems( 3 ) + INTEGER( I4B ) :: ii + + CALL GetFacetElements(elemType=Triangle6, nsd=2, ans=facetElems) + + DO ii = 1, SIZE( facetElems ) + CALL Display( facetElems( ii ), & + & "facetElements( " // tostring(ii) // " ) = " ) + CALL Blanklines( NOL = 2 ) + END DO +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceElement/examples/_ReferenceTopology_test_1.md b/docs/docs-api/ReferenceElement/examples/_ReferenceTopology_test_1.md new file mode 100644 index 000000000..a3053f82b --- /dev/null +++ b/docs/docs-api/ReferenceElement/examples/_ReferenceTopology_test_1.md @@ -0,0 +1,16 @@ +--- +title: ReferenceElement ReferenceTopology Example 1 +--- + +In this example you will learn how to create a `ReferenceTopology`. + +```fortran +PROGRAM main + USE easifemBase + TYPE( ReferenceTopology_ ) :: obj + + obj = ReferenceTopology( nptrs = [1,2,3], name=Triangle3 ) + CALL Display( obj, "test-1 obj : ") + CALL OK( (.NNE. obj) .eq. 3, "nne : ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/Initiate.md b/docs/docs-api/ReferenceHexahedron/Initiate.md index 39e10f9e5..d1dd04ee2 100644 --- a/docs/docs-api/ReferenceHexahedron/Initiate.md +++ b/docs/docs-api/ReferenceHexahedron/Initiate.md @@ -1,3 +1,7 @@ +--- +sidebar_position: 3 +--- + # Initiate This subroutine initiate an instance of ReferenceHexahedron. @@ -8,7 +12,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; - + ```fortran INTERFACE Initiate @@ -26,16 +30,16 @@ number of spatial dimension, it should be 3. :::info `xij` xij is the nodal coordinate of hexahedron. + - total number of rows in xij should be 3 as each row denotes a spatial dimension. - total number of columns in xij should be 8 as each column denotes the node number. -::: - + ::: -import EXAMPLE10 from "./_Initiate_test_1.md"; +import EXAMPLE10 from "./examples/_Initiate_test_1.md"; @@ -46,13 +50,12 @@ import EXAMPLE10 from "./_Initiate_test_1.md"; - ## Interface 2 (ReferenceHexahedron) We can use `ReferenceHexahedron` function to construct an instance of ReferenceHexahedron. - + ```fortran INTERFACE ReferenceHexahedron @@ -68,7 +71,7 @@ END INTERFACE ReferenceHexahedron -import EXAMPLE54 from "./_Initiate_test_2.md"; +import EXAMPLE54 from "./examples/_Initiate_test_2.md"; @@ -79,13 +82,12 @@ import EXAMPLE54 from "./_Initiate_test_2.md"; - ## Interface 3 (ReferenceHexahedron_Pointer) The function `ReferenceHexahedron_Pointer` returns the pointer to newly created instance of ReferenceHexahedron. - + ```fortran INTERFACE ReferenceHexahedron_Pointer @@ -101,7 +103,7 @@ END INTERFACE ReferenceHexahedron_Pointer -import EXAMPLE87 from "./_Initiate_test_3.md"; +import EXAMPLE87 from "./examples/_Initiate_test_3.md"; @@ -111,4 +113,3 @@ import EXAMPLE87 from "./_Initiate_test_3.md"; - diff --git a/docs/docs-api/ReferenceHexahedron/examples/_ElementName_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_ElementName_test_1.md new file mode 100644 index 000000000..93862acc5 --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_ElementName_test_1.md @@ -0,0 +1,13 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK( ElementName_Hexahedron(Hexahedron8) .EQ. "Hexahedron8", "ElementName_Hexahedron: " ) +CALL OK( ElementName_Hexahedron(Hexahedron20) .EQ. "Hexahedron20", "ElementName_Hexahedron: " ) +CALL OK( ElementName_Hexahedron(Hexahedron27) .EQ. "Hexahedron27", "ElementName_Hexahedron: " ) +CALL OK( ElementName_Hexahedron(Hexahedron64) .EQ. "Hexahedron64", "ElementName_Hexahedron: " ) +CALL OK( ElementName_Hexahedron(Hexahedron125) .EQ. "Hexahedron125", "ElementName_Hexahedron: " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_ElementOrder_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_ElementOrder_test_1.md new file mode 100644 index 000000000..edf5924c4 --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_ElementOrder_test_1.md @@ -0,0 +1,19 @@ +--- +title: ElementOrder_Hexahedron example 1 +--- + +```fortran +PROGRAM main + USE easifemBase + IMPLICIT NONE + + CALL OK(ElementOrder_Hexahedron(elemType=Hexahedron8) .EQ. 1, & + & "ElementOrder_Hexahedron(1): ") + + CALL OK(ElementOrder_Hexahedron(elemType=Hexahedron20) .EQ. 2, & + & "ElementOrder_Hexahedron(2): ") + + CALL OK(ElementOrder_Hexahedron(elemType=Hexahedron27) .EQ. 2, & + & "ElementOrder_Hexahedron(3): ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_ElementType_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_ElementType_test_1.md new file mode 100644 index 000000000..de6e67437 --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_ElementType_test_1.md @@ -0,0 +1,27 @@ +--- +title: ElementType_Hexahedron example 1 +--- + +```fortran +PROGRAM main + USE easifemBase + IMPLICIT NONE + + CALL OK(ElementType_Hexahedron("Hexahedron8") .EQ. Hexahedron8, & + & "ElementType_Hexahedron: ") + + CALL OK(ElementType_Hexahedron("Hexahedron20") .EQ. Hexahedron20, & + & "ElementType_Hexahedron: ") + + + CALL OK(ElementType_Hexahedron("Hexahedron27") .EQ. Hexahedron27, & + & "ElementType_Hexahedron: ") + + CALL OK(ElementType_Hexahedron("Hexahedron64") .EQ. Hexahedron64, & + & "ElementType_Hexahedron: ") + + CALL OK(ElementType_Hexahedron("Hexahedron125") .EQ. Hexahedron125, & + & "ElementType_Hexahedron: ") + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_1.md new file mode 100644 index 000000000..2d1bbb4cc --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_1.md @@ -0,0 +1,20 @@ +--- +title: FacetElements Example 1 +--- + +```fortran +PROGRAM main +USE easifembase +IMPLICIT NONE + +TYPE(ReferenceHexahedron_) :: obj +TYPE(ReferenceElement_ ) :: faces(6) + + +CALL Initiate(obj=obj, nsd=3) +CALL FacetElements_Hexahedron(obj, faces) + +CALL Display(faces(1), "faces(1): " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_2.md b/docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_2.md new file mode 100644 index 000000000..0f177bc4b --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_FacetElements_test_2.md @@ -0,0 +1,17 @@ +--- +title: FacetElements Example 2 +--- + +```fortran +PROGRAM main +USE easifembase +IMPLICIT NONE +TYPE(ReferenceElement_) :: faces(6) + +CALL FacetElements_Hexahedron(elemType=Hexahedron8, nsd=3, ans=faces) +CALL Display(faces(1), "faces(1): ") + +CALL FacetElements_Hexahedron(elemType=Hexahedron20, nsd=3, ans=faces) +CALL Display(faces(1), "faces(1): ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_FacetTopology_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_FacetTopology_test_1.md new file mode 100644 index 000000000..8f21cb304 --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_FacetTopology_test_1.md @@ -0,0 +1,15 @@ +--- +title: FacetTopology Example 1 +--- + +```fortran +PROGRAM main +USE easifemBase + +BLOCK + TYPE(ReferenceTopology_) :: ans(6) + CALL FacetTopology_Hexahedron(Hexahedron8, arange(1, 8), ans) + CALL Display(ans(2), "second face: ") +END BLOCK +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_GetFaceElemType_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_GetFaceElemType_test_1.md new file mode 100644 index 000000000..d5d842892 --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_GetFaceElemType_test_1.md @@ -0,0 +1,21 @@ +--- +title: GetFaceElemType example 1 +--- + +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +BLOCK + INTEGER(I4B) :: faceElemType(6), tFaceNodes(6) + + CALL GetFaceElemType_Hexahedron(faceElemType=faceElemType, & + & tFaceNodes=tFaceNodes, elemType=Hexahedron8) + + CALL OK(ALL(faceElemType .EQ. Quadrangle4), "faceElemType(1): ") + CALL OK(ALL(tFaceNodes .EQ. 4), "tFaceNodes(2): ") + +END BLOCK +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_HighOrderElement_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_HighOrderElement_test_1.md new file mode 100644 index 000000000..79e025f1d --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_HighOrderElement_test_1.md @@ -0,0 +1,16 @@ +```fortran +PROGRAM main +USE easifembase +IMPLICIT NONE + +TYPE(ReferenceHexahedron_) :: obj, high_obj +INTEGER(I4B), PARAMETER :: nsd = 3_I4B + +CALL Initiate(obj=obj, nsd=nsd) + +CALL obj%highOrderElement(order=2, highOrderObj=high_obj, & + & iptype=Equidistance) + +CALL Display(high_obj, 'second order Obj : ') +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/_Initiate_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_1.md similarity index 97% rename from docs/docs-api/ReferenceHexahedron/_Initiate_test_1.md rename to docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_1.md index 1c8f1d812..743159a7a 100644 --- a/docs/docs-api/ReferenceHexahedron/_Initiate_test_1.md +++ b/docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_1.md @@ -1,11 +1,9 @@ ```fortran PROGRAM main USE easifembase -USE easifemclasses IMPLICIT NONE TYPE(ReferenceHexahedron_) :: obj -REAL(dfp) :: avar -INTEGER(i4b), PARAMETER :: nsd = 3_I4B +INTEGER(I4B), PARAMETER :: nsd = 3_I4B CALL Initiate(obj=obj, nsd=nsd) CALL Display(obj, 'Obj : ') @@ -265,7 +263,7 @@ Obj : 5 6 7 - 8 + 8 ``` diff --git a/docs/docs-api/ReferenceHexahedron/_Initiate_test_2.md b/docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_2.md similarity index 97% rename from docs/docs-api/ReferenceHexahedron/_Initiate_test_2.md rename to docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_2.md index ff96b8fda..82d189fc0 100644 --- a/docs/docs-api/ReferenceHexahedron/_Initiate_test_2.md +++ b/docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_2.md @@ -1,11 +1,10 @@ ```fortran PROGRAM main USE easifembase -USE easifemclasses IMPLICIT NONE + TYPE(ReferenceHexahedron_) :: obj -REAL(dfp) :: avar -INTEGER(i4b), PARAMETER :: nsd = 3_I4B +INTEGER(I4B), PARAMETER :: nsd = 3_I4B obj = ReferenceHexahedron(nsd=nsd) CALL Display(obj, 'Obj : ') @@ -265,7 +264,7 @@ Obj : 5 6 7 - 8 + 8 ``` diff --git a/docs/docs-api/ReferenceHexahedron/_Initiate_test_3.md b/docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_3.md similarity index 97% rename from docs/docs-api/ReferenceHexahedron/_Initiate_test_3.md rename to docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_3.md index 8878e5283..c88858b3a 100644 --- a/docs/docs-api/ReferenceHexahedron/_Initiate_test_3.md +++ b/docs/docs-api/ReferenceHexahedron/examples/_Initiate_test_3.md @@ -1,11 +1,9 @@ ```fortran PROGRAM main USE easifembase -USE easifemclasses IMPLICIT NONE CLASS(ReferenceElement_), pointer :: obj -REAL(dfp) :: avar -INTEGER(i4b), PARAMETER :: nsd = 3_I4B +INTEGER(I4B), PARAMETER :: nsd = 3_I4B obj => ReferenceHexahedron_Pointer(nsd=nsd) CALL Display(obj, 'Obj : ') @@ -265,7 +263,7 @@ Obj : 5 6 7 - 8 + 8 ``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_TotalEntities_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_TotalEntities_test_1.md new file mode 100644 index 000000000..f327291f6 --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_TotalEntities_test_1.md @@ -0,0 +1,18 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK(ALL(TotalEntities_Hexahedron(Hexahedron8) .EQ. [8, 12, 6, 1]), & + & "TotalEntities_Hexahedron: ") + +CALL OK(ALL(TotalEntities_Hexahedron(Hexahedron20) .EQ. [20, 12, 6, 1]), & + & "TotalEntities_Hexahedron: ") + +CALL OK(ALL(TotalEntities_Hexahedron(Hexahedron27) .EQ. [27, 12, 6, 1]), & + & "TotalEntities_Hexahedron: ") + +CALL OK(ALL(TotalEntities_Hexahedron(Hexahedron64) .EQ. [64, 12, 6, 1]), & + & "TotalEntities_Hexahedron: ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/examples/_TotalNodesInElement_test_1.md b/docs/docs-api/ReferenceHexahedron/examples/_TotalNodesInElement_test_1.md new file mode 100644 index 000000000..d5e56bf72 --- /dev/null +++ b/docs/docs-api/ReferenceHexahedron/examples/_TotalNodesInElement_test_1.md @@ -0,0 +1,16 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE +CALL OK(TotalNodesInElement_Hexahedron(Hexahedron8) .EQ. 8, & + & "TotalNodesInElement_Hexahedron: ") +CALL OK(TotalNodesInElement_Hexahedron(Hexahedron20) .EQ. 20, & + & "TotalNodesInElement_Hexahedron: ") +CALL OK(TotalNodesInElement_Hexahedron(Hexahedron27) .EQ. 27, & + & "TotalNodesInElement_Hexahedron: ") +CALL OK(TotalNodesInElement_Hexahedron(Hexahedron64) .EQ. 64, & + & "TotalNodesInElement_Hexahedron: ") +CALL OK(TotalNodesInElement_Hexahedron(Hexahedron125) .EQ. 125, & + & "TotalNodesInElement_Hexahedron: ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceHexahedron/index.md b/docs/docs-api/ReferenceHexahedron/index.md index e33a1c3da..d4b39f722 100644 --- a/docs/docs-api/ReferenceHexahedron/index.md +++ b/docs/docs-api/ReferenceHexahedron/index.md @@ -1,13 +1,13 @@ --- sidebar_position: 1 -date: 2023-07-07 -update: 2023-07-07 +date: 2023-07-07 +update: 2023-07-07 status: stable docs: done extpkgs: none -category: +category: - Geometry -tags: +tags: - easifemBase - geometry - referenceElement @@ -15,7 +15,12 @@ tags: # ReferenceHexahedron -## Methods +`ReferenceHexahedron_` is defined in `BaseType` module. It denotes the reference +element domain for tetrahedron. + +It is reference element for `Hexahedron`, and a child of `ReferenceElement_`. + +## All methods import DocCardList from '@theme/DocCardList'; diff --git a/docs/docs-api/ReferenceLine/Initiate.md b/docs/docs-api/ReferenceLine/Initiate.md index 59963c017..e7968e0c4 100644 --- a/docs/docs-api/ReferenceLine/Initiate.md +++ b/docs/docs-api/ReferenceLine/Initiate.md @@ -1,6 +1,7 @@ # Initiate -This subroutine constructs an instance of ReferenceLine element of order equal to 1. +This subroutine constructs an instance of `ReferenceLine_` element of +order equal to 1. ## Interface @@ -17,23 +18,23 @@ END SUBROUTINE initiate_ref_Line END INTERFACE Initiate ``` -:::info `xij` -`XiJ` denotes the nodal coordinate, if it is not present than we use following values: +> `XiJ` denotes the nodal coordinate, if it is not present than we use following +> values: -| | | -| --- | --- | -| -1 | 1 | -| 0 | 0 | -| 0 | 0 | -::: +| | | +| --- | - | +| -1 | 1 | +| 0 | 0 | +| 0 | 0 | +| ::: | | -:::note -The `SIZE(XiJ,1)` should be equal to 3, i.e., x,y,z coord. Also, this routine creates a linear element. -::: +> The `SIZE(XiJ,1)` should be equal to 3, i.e., x,y,z coordinate. +> Also, this routine creates a linear element. ## ReferenceLine (Constructor) -This function constructs an instance of ReferenceLine_ element of order equal to 1. +This function constructs an instance of `ReferenceLine_` element of order +equal to 1. ```fortran INTERFACE ReferenceLine @@ -47,7 +48,8 @@ END INTERFACE ReferenceLine ### ReferenceLine_Pointer -This function returns a pointer to a newly created instance of ReferenceLine_ element of order equal to 1. +This function returns a pointer to a newly created instance of +`ReferenceLine_` element of order equal to 1. ```fortran INTERFACE ReferenceLine_Pointer diff --git a/docs/docs-api/ReferenceLine/ReferenceLine_.md b/docs/docs-api/ReferenceLine/ReferenceLine_.md index 7e200bfa2..74906c701 100644 --- a/docs/docs-api/ReferenceLine/ReferenceLine_.md +++ b/docs/docs-api/ReferenceLine/ReferenceLine_.md @@ -2,6 +2,7 @@ sidebar_position: 2 --- -# ReferenceLine +# Structure -Datatype for reference line element. It is a child of ReferenceElement_. +This is a data type for reference line element. +It is a child of `ReferenceElement_`. diff --git a/docs/docs-api/ReferenceLine/_ReferenceLine_test_1.md b/docs/docs-api/ReferenceLine/_ReferenceLine_test_1.md deleted file mode 100644 index ff881a743..000000000 --- a/docs/docs-api/ReferenceLine/_ReferenceLine_test_1.md +++ /dev/null @@ -1,24 +0,0 @@ -Use of following methods: - -- ReferenceLine -- MeasureSimplex -- LagrangeElement -- ReferenceLine_Pointer - -``` fortran -PROGRAM main - TYPE( ReferenceLine_ ) :: obj1, obj2, obj3 - CLASS( ReferenceElement_ ), POINTER :: obj_ptr1 => NULL() - REAL( DFP ) :: xij( 3, 2 ) - CALL RANDOM_NUMBER( xij ) - CALL Initiate( obj=obj1, NSD=3 ) - CALL display( obj1, "obj1 : " ) - CALL display( MeasureSimplex(obj1, obj1%xij), "measure = ") - obj2 = ReferenceLine(nsd=3) - CALL display( obj2, 'obj2 : ' ) - CALL obj1%LagrangeElement( Order=2, HighOrderobj=obj3 ) - CALL display( obj3, "Second Order Lagrange Element : ") - obj_ptr1 => ReferenceLine_Pointer( nsd = 3, xij = xij ) - CALL display( obj_ptr1, "obj_ptr1 : ") -END PROGRAM main -``` diff --git a/docs/docs-api/ReferenceLine/_ReferenceLine_test_2.md b/docs/docs-api/ReferenceLine/_ReferenceLine_test_2.md deleted file mode 100644 index ae03a9bf0..000000000 --- a/docs/docs-api/ReferenceLine/_ReferenceLine_test_2.md +++ /dev/null @@ -1,11 +0,0 @@ -``` fortran -PROGRAM main - CLASS( ReferenceElement_ ), POINTER :: obj_ptr => NULL() - TYPE( ReferenceLine_ ) :: obj - obj_ptr => ReferenceLine_Pointer(nsd=1) - CALL display( obj_ptr, 'obj_ptr : ' ) - CALL obj_ptr%LagrangeElement( Order=2, HighOrderobj=obj ) - CALL display( obj, "Second Order Lagrange Element : ") - CALL display( MeasureSimplex(obj, obj%xij), "Measuresimplex : ") -END PROGRAM main -``` diff --git a/docs/docs-api/ReferenceLine/examples/_ElementName_test_1.md b/docs/docs-api/ReferenceLine/examples/_ElementName_test_1.md new file mode 100644 index 000000000..7ed8bdf9f --- /dev/null +++ b/docs/docs-api/ReferenceLine/examples/_ElementName_test_1.md @@ -0,0 +1,13 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK( ElementName_Line(Line2) .EQ. "Line2", "ElementName_Line: " ) +CALL OK( ElementName_Line(Line3) .EQ. "Line3", "ElementName_Line: " ) +CALL OK( ElementName_Line(Line4) .EQ. "Line4", "ElementName_Line: " ) +CALL OK( ElementName_Line(Line5) .EQ. "Line5", "ElementName_Line: " ) +CALL OK( ElementName_Line(Line6) .EQ. "Line6", "ElementName_Line: " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceLine/examples/_ElementName_test_2.md b/docs/docs-api/ReferenceLine/examples/_ElementName_test_2.md new file mode 100644 index 000000000..22e0fc16d --- /dev/null +++ b/docs/docs-api/ReferenceLine/examples/_ElementName_test_2.md @@ -0,0 +1,26 @@ +! This program is a part of EASIFEM library +! Copyright (C) 2020-2021 Vikas Sharma, Ph.D +! +! This program is free software: you can redistribute it and/or modify +! it under the terms of the GNU General Public License as published by +! the Free Software Foundation, either version 3 of the License, or +! (at your option) any later version. +! +! This program is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU General Public License for more details. +! +! You should have received a copy of the GNU General Public License +! along with this program. If not, see +! + +PROGRAM main +USE easifemBase +IMPLICIT NONE +TYPE(ReferenceLine_) :: obj +Type(String) :: astr +obj = ReferenceLine(nsd=1_I4B) +astr = ElementName(obj) +CALL OK(astr .EQ. "Line2", "ElementName" ) +END PROGRAM main diff --git a/docs/docs-api/ReferenceLine/examples/_FacetTopology_test_1.md b/docs/docs-api/ReferenceLine/examples/_FacetTopology_test_1.md new file mode 100644 index 000000000..04f1ce8a1 --- /dev/null +++ b/docs/docs-api/ReferenceLine/examples/_FacetTopology_test_1.md @@ -0,0 +1,22 @@ +--- +title: FacetTopology Example 1 +--- + +```fortran +program main +use easifemBase + +block + TYPE(ReferenceTopology_) :: ans(2) + CALL FacetTopology_Line(Line2, [1,2], ans) + CALL Display(ans(2), "second face: ") +end block + +block + TYPE(ReferenceTopology_) :: ans(2) + CALL FacetTopology_Line(Line3, [1,2,3], ans) + CALL Display(ans(2), "second face: ") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceLine/_NNE_test_1.md b/docs/docs-api/ReferenceLine/examples/_NNE_test_1.md similarity index 100% rename from docs/docs-api/ReferenceLine/_NNE_test_1.md rename to docs/docs-api/ReferenceLine/examples/_NNE_test_1.md diff --git a/docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_1.md b/docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_1.md new file mode 100644 index 000000000..b45ae16c3 --- /dev/null +++ b/docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_1.md @@ -0,0 +1,30 @@ +--- +title: ReferenceLine example 1 +--- + +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE +TYPE(ReferenceLine_) :: obj +REAL(DFP) :: avar, xij(1, 2) + +obj = ReferenceLine(nsd=1_I4B) +CALL OK(obj%domainName .EQ. "BIUNIT", "tests: ") + +obj = ReferenceLine(nsd=1_I4B, domainName="UNIT") +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceLine(nsd=1_I4B, domainName="BIUNIT") +CALL OK(obj%domainName .EQ. "BIUNIT", "tests: ") + +obj = ReferenceLine(nsd=1_I4B, xij=RefCoord_Line("UNIT")) +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceLine(nsd=1_I4B, xij=RefCoord_Line("BIUNIT")) +CALL OK(obj%domainName .EQ. "BIUNIT", "tests: ") + +obj = ReferenceLine(nsd=1_I4B, xij=2.0_DFP * RefCoord_Line("BIUNIT")) +CALL OK(obj%domainName .EQ. "GENERAL", "tests: ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_2.md b/docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_2.md new file mode 100644 index 000000000..d4dc28e8b --- /dev/null +++ b/docs/docs-api/ReferenceLine/examples/_ReferenceLine_test_2.md @@ -0,0 +1,22 @@ +--- +title: ReferenceLine_Pointer example 1 +--- + +In this example we make higher order line element. + +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CLASS(ReferenceElement_), POINTER :: obj_ptr => NULL() +TYPE(ReferenceLine_) :: obj + +obj_ptr => ReferenceLine_Pointer(nsd=1) + +CALL Display(obj_ptr, 'obj_ptr : ') +CALL obj_ptr%highOrderElement(Order=2, highOrderobj=obj, ipType=Equidistance) + +CALL Display(obj, "Second Order Lagrange Element : ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceLine/examples/_TotalEntities_test_1.md b/docs/docs-api/ReferenceLine/examples/_TotalEntities_test_1.md new file mode 100644 index 000000000..d3adbb17f --- /dev/null +++ b/docs/docs-api/ReferenceLine/examples/_TotalEntities_test_1.md @@ -0,0 +1,16 @@ +--- +title: TotalEntities_Line example 1 +--- + +```fortran +PROGRAM main +USE easifemBase + +IMPLICIT NONE + +CALL Display(TotalEntities_Line(Line), "Line: ") +CALL Display(TotalEntities_Line(Line3), "Line3: ") +CALL Display(TotalEntities_Line(Line4), "Line4: ") + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceLine/index.md b/docs/docs-api/ReferenceLine/index.md index 866929cae..6ac2363f0 100644 --- a/docs/docs-api/ReferenceLine/index.md +++ b/docs/docs-api/ReferenceLine/index.md @@ -15,7 +15,8 @@ tags: # ReferenceLine -`ReferenceLine` data type is a child of `ReferenceElement`. It defines the reference line element. +`ReferenceLine_` data type is a child of `ReferenceElement_`. +It defines the reference line element. ## Methods diff --git a/docs/docs-api/ReferencePrism/examples/_ElementName_test_1.md b/docs/docs-api/ReferencePrism/examples/_ElementName_test_1.md new file mode 100644 index 000000000..77244c4a8 --- /dev/null +++ b/docs/docs-api/ReferencePrism/examples/_ElementName_test_1.md @@ -0,0 +1,11 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK( ElementName_Prism(Prism6) .EQ. "Prism6", "ElementName_Prism: " ) +CALL OK( ElementName_Prism(Prism15) .EQ. "Prism15", "ElementName_Prism: " ) +CALL OK( ElementName_Prism(Prism18) .EQ. "Prism18", "ElementName_Prism: " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferencePyramid/examples/_ElementName_test_1.md b/docs/docs-api/ReferencePyramid/examples/_ElementName_test_1.md new file mode 100644 index 000000000..0a4be35bf --- /dev/null +++ b/docs/docs-api/ReferencePyramid/examples/_ElementName_test_1.md @@ -0,0 +1,11 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK( ElementName_Pyramid(Pyramid5) .EQ. "Pyramid5", "ElementName_Pyramid: " ) +CALL OK( ElementName_Pyramid(Pyramid13) .EQ. "Pyramid13", "ElementName_Pyramid: " ) +CALL OK( ElementName_Pyramid(Pyramid14) .EQ. "Pyramid14", "ElementName_Pyramid: " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceQuadrangle/Initiate.md b/docs/docs-api/ReferenceQuadrangle/Initiate.md index c88261a9e..81f50efd7 100644 --- a/docs/docs-api/ReferenceQuadrangle/Initiate.md +++ b/docs/docs-api/ReferenceQuadrangle/Initiate.md @@ -24,7 +24,7 @@ END INTERFACE Initiate -import EXAMPLE10 from "./_Initiate_test_1.md"; +import EXAMPLE10 from "./examples/_Initiate_test_1.md"; @@ -56,7 +56,7 @@ This function retuns an instance of linear quadrangle element. -import EXAMPLE40 from "./_Initiate_test_2.md"; +import EXAMPLE40 from "./examples/_Initiate_test_2.md"; @@ -88,7 +88,7 @@ This function returns pointer to newly created linear quadrangle elements. -import EXAMPLE72 from "./_Initiate_test_3.md"; +import EXAMPLE72 from "./examples/_Initiate_test_3.md"; @@ -130,13 +130,13 @@ Interpolation point type. It can take following values: - GaussChebyshev - GaussUltrasphericalLobatto - GaussJacobi -::: + ::: -import EXAMPLE105 from "./_Initiate_test_4.md"; +import EXAMPLE105 from "./examples/_Initiate_test_4.md"; diff --git a/docs/docs-api/ReferenceQuadrangle/ReferenceQuadrangle_.md b/docs/docs-api/ReferenceQuadrangle/ReferenceQuadrangle_.md index 79264b064..76571be62 100644 --- a/docs/docs-api/ReferenceQuadrangle/ReferenceQuadrangle_.md +++ b/docs/docs-api/ReferenceQuadrangle/ReferenceQuadrangle_.md @@ -1,5 +1,7 @@ # ReferenceQuadrangle -ReferenceQuadrangl is user data type for handling quadrangle elements. +`ReferenceQuadrangl` is user data type for handling quadrangle elements. -ReferenceQuadrangle is a child of ReferenceElement_. +It is defined in the `BaseType.F90` module. + +It is a child of `ReferenceElement_`. diff --git a/docs/docs-api/ReferenceQuadrangle/examples/_ElementName_test_1.md b/docs/docs-api/ReferenceQuadrangle/examples/_ElementName_test_1.md new file mode 100644 index 000000000..09ee1ab38 --- /dev/null +++ b/docs/docs-api/ReferenceQuadrangle/examples/_ElementName_test_1.md @@ -0,0 +1,12 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK( ElementName_Quadrangle(Quadrangle4) .EQ. "Quadrangle4", "ElementName_Quadrangle: " ) +CALL OK( ElementName_Quadrangle(Quadrangle8) .EQ. "Quadrangle8", "ElementName_Quadrangle: " ) +CALL OK( ElementName_Quadrangle(Quadrangle9) .EQ. "Quadrangle9", "ElementName_Quadrangle: " ) +CALL OK( ElementName_Quadrangle(Quadrangle16) .EQ. "Quadrangle16", "ElementName_Quadrangle: " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_1.md b/docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_1.md new file mode 100644 index 000000000..06aec43ed --- /dev/null +++ b/docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_1.md @@ -0,0 +1,28 @@ +--- +title: ReferenceQuadrangle FacetElements Example 1 +--- + +```fortran +program main +use easifemBase + +block +TYPE(ReferenceElement_) :: ans(4) +CALL FacetElements_Quadrangle(Quadrangle4, 2, ans) +CALL Display(ans(2), "case 1 second face: ") +end block + +block +TYPE(ReferenceElement_) :: ans(4) +CALL FacetElements_Quadrangle(Quadrangle8, 2, ans) +CALL Display(ans(2), "case 2 second face: ") +end block + +block +TYPE(ReferenceElement_) :: ans(4) +CALL FacetElements_Quadrangle(Quadrangle9, 2, ans) +CALL Display(ans(2), "case 3 second face: ") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_2.md b/docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_2.md new file mode 100644 index 000000000..7f2fd3f16 --- /dev/null +++ b/docs/docs-api/ReferenceQuadrangle/examples/_FacetElements_test_2.md @@ -0,0 +1,19 @@ +--- +title: ReferenceQuadrangle FacetElements Example 2 +--- + +```fortran +program main +use easifemBase + +type(ReferenceQuadrangle_) :: obj +call Initiate(obj=obj, nsd=2) + +block +TYPE(ReferenceElement_) :: ans(4) +CALL FacetElements_Quadrangle(obj, ans) +CALL Display(ans(2), "case 1 second face: ") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceQuadrangle/examples/_FacetTopology_test_1.md b/docs/docs-api/ReferenceQuadrangle/examples/_FacetTopology_test_1.md new file mode 100644 index 000000000..80a1a227f --- /dev/null +++ b/docs/docs-api/ReferenceQuadrangle/examples/_FacetTopology_test_1.md @@ -0,0 +1,22 @@ +--- +title: FacetTopology_Quadrangle Example 1 +--- + +```fortran +program main +use easifemBase + +block + TYPE(ReferenceTopology_) :: ans(4) + CALL FacetTopology_Quadrangle(Quadrangle4, [1,2,3,4], ans) + CALL Display(ans(2), "second face: ") +end block + +block + TYPE(ReferenceTopology_) :: ans(4) + CALL FacetTopology_Quadrangle(Quadrangle8, [1,2,3,4,5,6,7,8], ans) + CALL Display(ans(2), "second face: ") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceQuadrangle/examples/_GetEdgeConnectivity_test_1.md b/docs/docs-api/ReferenceQuadrangle/examples/_GetEdgeConnectivity_test_1.md new file mode 100644 index 000000000..95a35cc24 --- /dev/null +++ b/docs/docs-api/ReferenceQuadrangle/examples/_GetEdgeConnectivity_test_1.md @@ -0,0 +1,34 @@ +--- +title: ReferenceQuadrangle GetEdgeConnectivity Example 1 +--- + +```fortran +program main +use easifemBase + +block +INTEGER( I4B ) :: con(2, 4) +CALL GetEdgeConnectivity_Quadrangle(con=con, order=1) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +block +INTEGER( I4B ) :: con(3, 4) +CALL GetEdgeConnectivity_Quadrangle(con=con, order=2) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +block +INTEGER( I4B ) :: con(2, 4) +CALL GetEdgeConnectivity_Quadrangle(con=con, order=1, opt=2) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +block +INTEGER( I4B ) :: con(3, 4) +CALL GetEdgeConnectivity_Quadrangle(con=con, order=2, opt=2) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceQuadrangle/_Initiate_test_1.md b/docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_1.md similarity index 95% rename from docs/docs-api/ReferenceQuadrangle/_Initiate_test_1.md rename to docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_1.md index afce2e7ee..6776d0044 100644 --- a/docs/docs-api/ReferenceQuadrangle/_Initiate_test_1.md +++ b/docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_1.md @@ -2,8 +2,8 @@ program main use easifemBase type(ReferenceQuadrangle_) :: refelem -call initiate(obj=refelem, nsd=2) -call display(refelem, "ans: ") +call Initiate(obj=refelem, nsd=2) +call Display(refelem, "ans: ") end program main ``` @@ -102,7 +102,7 @@ ans: 1 2 3 - 4 + 4 ``` diff --git a/docs/docs-api/ReferenceQuadrangle/_Initiate_test_2.md b/docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_2.md similarity index 100% rename from docs/docs-api/ReferenceQuadrangle/_Initiate_test_2.md rename to docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_2.md diff --git a/docs/docs-api/ReferenceQuadrangle/_Initiate_test_3.md b/docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_3.md similarity index 100% rename from docs/docs-api/ReferenceQuadrangle/_Initiate_test_3.md rename to docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_3.md diff --git a/docs/docs-api/ReferenceQuadrangle/_Initiate_test_4.md b/docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_4.md similarity index 100% rename from docs/docs-api/ReferenceQuadrangle/_Initiate_test_4.md rename to docs/docs-api/ReferenceQuadrangle/examples/_Initiate_test_4.md diff --git a/docs/docs-api/ReferenceQuadrangle/examples/_TotalEntities_test_1.md b/docs/docs-api/ReferenceQuadrangle/examples/_TotalEntities_test_1.md new file mode 100644 index 000000000..f1f82b33f --- /dev/null +++ b/docs/docs-api/ReferenceQuadrangle/examples/_TotalEntities_test_1.md @@ -0,0 +1,16 @@ +--- +title: TotalEntities_Quadrangle example 1 +--- + +```fortran +PROGRAM main +USE easifemBase + +IMPLICIT NONE + +CALL Display(TotalEntities_Quadrangle(Quadrangle), "Quadrangle: ") +CALL Display(TotalEntities_Quadrangle(Quadrangle8), "Quadrangle8: ") +CALL Display(TotalEntities_Quadrangle(Quadrangle9), "Quadrangle8: ") + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceQuadrangle/index.md b/docs/docs-api/ReferenceQuadrangle/index.md index c36308653..e36ccdf26 100644 --- a/docs/docs-api/ReferenceQuadrangle/index.md +++ b/docs/docs-api/ReferenceQuadrangle/index.md @@ -1,13 +1,13 @@ --- sidebar_position: 1 -date: 2023-07-07 -update: 2023-07-07 +date: 2023-07-07 +update: 2023-07-07 status: stable docs: done extpkgs: none -category: +category: - Geometry -tags: +tags: - easifemBase - geometry - referenceElement @@ -15,9 +15,12 @@ tags: # ReferenceQuadrangle -`ReferenceQuadrangle` is a user-data type for quadrangle element. +`ReferenceQuadrangle_` is defined in `BaseType` module. It denotes the reference +element domain for tetrahedron. -## Methods +It is reference element for quadrangle and a child of `ReferenceElement_`. + +## All methods import DocCardList from '@theme/DocCardList'; diff --git a/docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_.md b/docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_.md index 5eac9ea67..017eb9a32 100644 --- a/docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_.md +++ b/docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_.md @@ -1,13 +1,7 @@ --- -title: ReferenceTetrahedron +title: ReferenceTetrahedron Methods --- -# ReferenceTetrahedron - -## Introduction - -It is reference element for tetrahedron, and a child of [[ReferenceElement_]] - ## Methods ### Initiate diff --git a/docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_test_1.md b/docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_test_1.md deleted file mode 100644 index b660ea27b..000000000 --- a/docs/docs-api/ReferenceTetrahedron/ReferenceTetrahedron_test_1.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -author: Vikas Sharma, Ph.D. -date: 10 Aug 2022 -tags: - - ReferenceTetrahedron - - ReferenceTetrahedron/Initiate - - ReferenceTetrahedron/Display ---- - -# ReferenceTetrahedron example 1 - -## Modules and classes - -- [[ReferenceTetrahedron_]] - -## Usage - -``` fortran -program main - use easifembase - use easifemclasses - implicit none - type( test_referenceTetrahedron_ ) :: obj - real( dfp ) :: avar - integer( i4b ), parameter :: nsd=3_I4B -``` - -!!! note "Initiate" - Initiate an instance of [[ReferenceTetrahedron_]] - -```fortran - CALL obj%Initiate(nsd=nsd) - CALL obj%display( 'Obj : ' ) -``` - -```fortran -END PROGRAM main -``` diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_ElementName_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_ElementName_test_1.md new file mode 100644 index 000000000..4675b7a37 --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_ElementName_test_1.md @@ -0,0 +1,13 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK( ElementName_Tetrahedron(Tetrahedron4) .EQ. "Tetrahedron4", "ElementName_Tetrahedron: " ) +CALL OK( ElementName_Tetrahedron(Tetrahedron10) .EQ. "Tetrahedron10", "ElementName_Tetrahedron: " ) +CALL OK( ElementName_Tetrahedron(Tetrahedron20) .EQ. "Tetrahedron20", "ElementName_Tetrahedron: " ) +CALL OK( ElementName_Tetrahedron(Tetrahedron35) .EQ. "Tetrahedron35", "ElementName_Tetrahedron: " ) +CALL OK( ElementName_Tetrahedron(Tetrahedron56) .EQ. "Tetrahedron56", "ElementName_Tetrahedron: " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_1.md new file mode 100644 index 000000000..08548ac79 --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_1.md @@ -0,0 +1,20 @@ +--- +title: ReferenceTetrahedron FacetElements Example 1 +--- + +```fortran +PROGRAM main +USE easifembase +IMPLICIT NONE + +TYPE(ReferenceTetrahedron_) :: obj +TYPE(ReferenceElement_ ) :: faces(4) + + +CALL Initiate(obj=obj, nsd=3) +CALL FacetElements_Tetrahedron(obj, faces) + +CALL Display(faces(1), "faces(1): " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_2.md b/docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_2.md new file mode 100644 index 000000000..315e8dacd --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_FacetElements_test_2.md @@ -0,0 +1,18 @@ +--- +title: ReferenceTetrahedron FacetElements Example 2 +--- + +```fortran +PROGRAM main +USE easifembase +IMPLICIT NONE + +TYPE(ReferenceElement_ ) :: faces(4) + + +CALL FacetElements_Tetrahedron(Tetrahedron4, 3, faces) + +CALL Display(faces(1), "faces(1): " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_FacetTopology_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_FacetTopology_test_1.md new file mode 100644 index 000000000..d2679cf29 --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_FacetTopology_test_1.md @@ -0,0 +1,22 @@ +--- +title: FaceTopology Example 1 +--- + +```fortran +PROGRAM main +USE easifembase +IMPLICIT NONE + +TYPE(ReferenceTopology_) :: topo(4) + + +CALL FacetTopology_Tetrahedron(ans=topo, elemType=Tetrahedron4, nptrs=[1,2,3,4]) +CALL Display(topo(1), "topo(1): " ) + +CALL FacetTopology_Tetrahedron(ans=topo, elemType=Tetrahedron10, & + & nptrs=arange(1, 10)) + +CALL Display(topo(1), "topo(1): " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_GetFaceElemType_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_GetFaceElemType_test_1.md new file mode 100644 index 000000000..82ad685e3 --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_GetFaceElemType_test_1.md @@ -0,0 +1,42 @@ +--- +title: GetFaceElemType example 1 +--- + +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE +INTEGER(I4B) :: faceElemType(4), tFaceNodes(4) + +BLOCK + CALL GetFaceElemType_Tetrahedron(faceElemType=faceElemType, & + & tFaceNodes=tFaceNodes, elemType=Tetrahedron4) + + CALL OK(ALL(faceElemType .EQ. Triangle3), & + & "GetFaceElemType_Tetrahedron test(1) :") + CALL OK(ALL(tFaceNodes .EQ. LagrangeDOF_Triangle(order=1)), & + & "GetFaceElemType_Tetrahedron test(2) :") +END BLOCK + +BLOCK + CALL GetFaceElemType_Tetrahedron(faceElemType=faceElemType, & + & tFaceNodes=tFaceNodes, elemType=Tetrahedron10) + + CALL OK(ALL(faceElemType .EQ. Triangle6), & + & "GetFaceElemType_Tetrahedron test(3) :") + CALL OK(ALL(tFaceNodes .EQ. LagrangeDOF_Triangle(order=2)), & + & "GetFaceElemType_Tetrahedron test(4) :") +END BLOCK + +BLOCK + CALL GetFaceElemType_Tetrahedron(faceElemType=faceElemType, & + & tFaceNodes=tFaceNodes, elemType=Tetrahedron20) + + CALL OK(ALL(faceElemType .EQ. Triangle10), & + & "GetFaceElemType_Tetrahedron test(5) :") + CALL OK(ALL(tFaceNodes .EQ. LagrangeDOF_Triangle(order=3)), & + & "GetFaceElemType_Tetrahedron test(6) :") +END BLOCK + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_HighOrderElement_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_HighOrderElement_test_1.md new file mode 100644 index 000000000..437b089c1 --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_HighOrderElement_test_1.md @@ -0,0 +1,16 @@ +```fortran +PROGRAM main +USE easifembase +IMPLICIT NONE + +TYPE(ReferenceTetrahedron_) :: obj, high_obj +INTEGER(I4B), PARAMETER :: nsd = 3_I4B + +CALL Initiate(obj=obj, nsd=nsd) + +CALL obj%highOrderElement(order=2, highOrderObj=high_obj, & + & iptype=Equidistance) + +CALL Display(high_obj, 'second order Obj : ') +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_1.md new file mode 100644 index 000000000..f007f5ea0 --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_1.md @@ -0,0 +1,205 @@ +--- +title: ReferenceTetrahedron Initiate Example 1 +--- + +```fortran +PROGRAM main +USE easifembase + +IMPLICIT NONE + +TYPE(ReferenceTetrahedron_) :: obj +INTEGER(I4B), PARAMETER :: nsd = 3_I4B + +CALL Initiate(obj=obj, nsd=nsd) +CALL Display(obj, 'obj : ') + +END PROGRAM main +``` + +
+Click here to see result +
+ +Result + +```txt +obj : +DomainName : UNIT +ElemType : Tetrahedron4 +XiDimension :: 3 +NSD : 3 +Order : 1 +EntityCounts(0) : 4 +EntityCounts(1) : 6 +EntityCounts(2) : 4 +EntityCounts(3) : 1 + +============================== +Node( 1 ) : +------------ + 0.00000 + 0.00000 + 0.00000 + +============================== +Node( 2 ) : +------------ + 1.00000 + 0.00000 + 0.00000 + +============================== +Node( 3 ) : +------------ + 0.00000 + 1.00000 + 0.00000 + +============================== +Node( 4 ) : +------------ + 0.00000 + 0.00000 + 1.00000 + +============================== +Topology( 1 ) : +ElemType: Point1 +XiDim: 0 +Nptrs: +------- + 1 + +============================== +Topology( 2 ) : +ElemType: Point1 +XiDim: 0 +Nptrs: +------- + 2 + +============================== +Topology( 3 ) : +ElemType: Point1 +XiDim: 0 +Nptrs: +------- + 3 + +============================== +Topology( 4 ) : +ElemType: Point1 +XiDim: 0 +Nptrs: +------- + 4 + +============================== +Topology( 5 ) : +ElemType: Line2 +XiDim: 1 +Nptrs: +------- + 1 + 2 + +============================== +Topology( 6 ) : +ElemType: Line2 +XiDim: 1 +Nptrs: +------- + 1 + 3 + +============================== +Topology( 7 ) : +ElemType: Line2 +XiDim: 1 +Nptrs: +------- + 1 + 4 + +============================== +Topology( 8 ) : +ElemType: Line2 +XiDim: 1 +Nptrs: +------- + 2 + 3 + +============================== +Topology( 9 ) : +ElemType: Line2 +XiDim: 1 +Nptrs: +------- + 2 + 4 + +============================== +Topology( 10 ) : +ElemType: Line2 +XiDim: 1 +Nptrs: +------- + 3 + 4 + +============================== +Topology( 11 ) : +ElemType: Triangle3 +XiDim: 2 +Nptrs: +------- + 1 + 3 + 2 + +============================== +Topology( 12 ) : +ElemType: Triangle3 +XiDim: 2 +Nptrs: +------- + 1 + 2 + 4 + +============================== +Topology( 13 ) : +ElemType: Triangle3 +XiDim: 2 +Nptrs: +------- + 1 + 4 + 3 + +============================== +Topology( 14 ) : +ElemType: Triangle3 +XiDim: 2 +Nptrs: +------- + 2 + 3 + 4 + +============================== +Topology( 15 ) : +ElemType: Tetrahedron4 +XiDim: 3 +Nptrs: +------- + 1 + 2 + 3 + 4 +``` + +
+
diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_2.md b/docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_2.md new file mode 100644 index 000000000..597c45b3f --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_Initiate_test_2.md @@ -0,0 +1,31 @@ +--- +title: ReferenceTetrahedron Initiate Example 2 +--- + +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +TYPE(ReferenceTetrahedron_) :: obj +REAL(DFP) :: avar, xij(3, 4) + +obj = ReferenceTetrahedron(nsd=3_I4B) +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceTetrahedron(nsd=3_I4B, domainName="UNIT") +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceTetrahedron(nsd=3_I4B, domainName="BIUNIT") +CALL OK(obj%domainName .EQ. "BIUNIT", "tests: ") + +obj = ReferenceTetrahedron(nsd=3_I4B, xij=RefCoord_Tetrahedron("UNIT")) +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceTetrahedron(nsd=3_I4B, xij=RefCoord_Tetrahedron("BIUNIT")) +CALL OK(obj%domainName .EQ. "BIUNIT", "tests: ") + +obj = ReferenceTetrahedron(nsd=3_I4B, xij=2.0_DFP*RefCoord_Tetrahedron("BIUNIT") ) +CALL OK(obj%domainName .EQ. "GENERAL", "tests: ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/_TetrahedronVolume3D_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_TetrahedronVolume3D_test_1.md similarity index 85% rename from docs/docs-api/ReferenceTetrahedron/_TetrahedronVolume3D_test_1.md rename to docs/docs-api/ReferenceTetrahedron/examples/_TetrahedronVolume3D_test_1.md index 8222b7b1b..d45dac17e 100644 --- a/docs/docs-api/ReferenceTetrahedron/_TetrahedronVolume3D_test_1.md +++ b/docs/docs-api/ReferenceTetrahedron/examples/_TetrahedronVolume3D_test_1.md @@ -1,3 +1,7 @@ +--- +title: ReferenceTetrahedron TetrahedronVolume3D Example +--- + ```fortran program main use easifemBase diff --git a/docs/docs-api/ReferenceTetrahedron/examples/_TotalEntities_test_1.md b/docs/docs-api/ReferenceTetrahedron/examples/_TotalEntities_test_1.md new file mode 100644 index 000000000..de2479212 --- /dev/null +++ b/docs/docs-api/ReferenceTetrahedron/examples/_TotalEntities_test_1.md @@ -0,0 +1,21 @@ +--- +title: ReferenceTetrahedron TotalEntities example 1 +--- + +```fortran +program main +use easifemBase +implicit none + +INTEGER(I4B) :: ans(4), exac_ans(4) + +ans = TotalEntities_Tetrahedron(Tetrahedron4) +exac_ans = [4, 6, 4, 1] +CALL OK(all(ans .eq. exac_ans), "TotalEntities_Tetrahedron: ") + +ans = TotalEntities_Tetrahedron(Tetrahedron10) +exac_ans = [10, 6, 4, 1] +CALL OK(all(ans .eq. exac_ans), "TotalEntities_Tetrahedron: ") + +end program main +``` diff --git a/docs/docs-api/ReferenceTetrahedron/index.md b/docs/docs-api/ReferenceTetrahedron/index.md index dd76cc5b5..0d752b887 100644 --- a/docs/docs-api/ReferenceTetrahedron/index.md +++ b/docs/docs-api/ReferenceTetrahedron/index.md @@ -15,6 +15,13 @@ tags: # ReferenceTetrahedron +`ReferenceTetrahedron_` is defined in `BaseType` module. It denotes the reference +element domain for tetrahedron. + +It is reference element for tetrahedron, and a child of `ReferenceElement_`. + +## All methods + import DocCardList from '@theme/DocCardList'; diff --git a/docs/docs-api/ReferenceTriangle/examples/_ElementName_test_1.md b/docs/docs-api/ReferenceTriangle/examples/_ElementName_test_1.md new file mode 100644 index 000000000..3a29650ba --- /dev/null +++ b/docs/docs-api/ReferenceTriangle/examples/_ElementName_test_1.md @@ -0,0 +1,16 @@ +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +CALL OK( ElementName_Triangle(Triangle3) .EQ. "Triangle3", "ElementName_Triangle: " ) +CALL OK( ElementName_Triangle(Triangle6) .EQ. "Triangle6", "ElementName_Triangle: " ) +CALL OK( ElementName_Triangle(Triangle9) .EQ. "Triangle9", "ElementName_Triangle: " ) +CALL OK( ElementName_Triangle(Triangle10) .EQ. "Triangle10", "ElementName_Triangle: " ) +CALL OK( ElementName_Triangle(Triangle12) .EQ. "Triangle12", "ElementName_Triangle: " ) +CALL OK( ElementName_Triangle(Triangle15a) .EQ. "Triangle15a", "ElementName_Triangle: " ) +CALL OK( ElementName_Triangle(Triangle15b) .EQ. "Triangle15b", "ElementName_Triangle: " ) +CALL OK( ElementName_Triangle(Triangle21) .EQ. "Triangle21", "ElementName_Triangle: " ) + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTriangle/examples/_FacetElements_test_1.md b/docs/docs-api/ReferenceTriangle/examples/_FacetElements_test_1.md new file mode 100644 index 000000000..587ac8857 --- /dev/null +++ b/docs/docs-api/ReferenceTriangle/examples/_FacetElements_test_1.md @@ -0,0 +1,22 @@ +--- +title: ReferenceTriangle FacetElements Example 1 +--- + +```fortran +program main +use easifemBase + +block +TYPE(ReferenceElement_) :: ans(3) +CALL FacetElements_Triangle(Triangle3, 2, ans) +CALL Display(ans(2), "second face: ") +end block + +block +TYPE(ReferenceElement_) :: ans(3) +CALL FacetElements_Triangle(Triangle6, 2, ans) +CALL Display(ans(2), "second face: ") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceTriangle/examples/_FacetTopology_test_1.md b/docs/docs-api/ReferenceTriangle/examples/_FacetTopology_test_1.md new file mode 100644 index 000000000..8360981d3 --- /dev/null +++ b/docs/docs-api/ReferenceTriangle/examples/_FacetTopology_test_1.md @@ -0,0 +1,22 @@ +--- +title: ReferenceTriangle FacetTopology Example 1 +--- + +```fortran +program main +use easifemBase + +block + TYPE(ReferenceTopology_) :: ans(3) + CALL FacetTopology_Triangle(Triangle3, [1,2,3], ans) + CALL Display(ans(2), "second face: ") +end block + +block + TYPE(ReferenceTopology_) :: ans(3) + CALL FacetTopology_Triangle(Triangle6, [1,2,3,4, 5,6], ans) + CALL Display(ans(2), "second face: ") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceTriangle/examples/_GetEdgeConnectivity_test_1.md b/docs/docs-api/ReferenceTriangle/examples/_GetEdgeConnectivity_test_1.md new file mode 100644 index 000000000..2010c6294 --- /dev/null +++ b/docs/docs-api/ReferenceTriangle/examples/_GetEdgeConnectivity_test_1.md @@ -0,0 +1,34 @@ +--- +title: ReferenceTriangle GetEdgeConnectivity Example 1 +--- + +```fortran +program main +use easifemBase + +block +INTEGER( I4B ) :: con(2, 3) +CALL GetEdgeConnectivity_Triangle(con=con, order=1) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +block +INTEGER( I4B ) :: con(3, 3) +CALL GetEdgeConnectivity_Triangle(con=con, order=2) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +block +INTEGER( I4B ) :: con(2, 3) +CALL GetEdgeConnectivity_Triangle(con=con, order=1, opt=2) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +block +INTEGER( I4B ) :: con(3, 3) +CALL GetEdgeConnectivity_Triangle(con=con, order=2, opt=2) +CALL Display(con, "GetEdgeConnectivity(order=2)") +end block + +end program main +``` diff --git a/docs/docs-api/ReferenceTriangle/examples/_HighOrderElement_test_1.md b/docs/docs-api/ReferenceTriangle/examples/_HighOrderElement_test_1.md new file mode 100644 index 000000000..5fbba006e --- /dev/null +++ b/docs/docs-api/ReferenceTriangle/examples/_HighOrderElement_test_1.md @@ -0,0 +1,22 @@ +--- +title: HighOrderElement Example 1 +--- + +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE + +TYPE(ReferenceTriangle_) :: obj +TYPE(ReferenceTriangle_) :: high_obj + +REAL(DFP) :: avar, xij(2, 3) + +CALL Initiate(obj=obj, nsd=2_I4B) + +CALL obj%highOrderElement(order=2, highOrderObj=high_obj, ipType=Equidistance) + +CALL Display(high_obj, "order 2 triangle:") + +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTriangle/examples/_Initiate_test_1.md b/docs/docs-api/ReferenceTriangle/examples/_Initiate_test_1.md new file mode 100644 index 000000000..b26780a2a --- /dev/null +++ b/docs/docs-api/ReferenceTriangle/examples/_Initiate_test_1.md @@ -0,0 +1,30 @@ +--- +title: ReferenceTriangle Initiate Example 1 +--- + +```fortran +PROGRAM main +USE easifemBase +IMPLICIT NONE +TYPE(ReferenceTriangle_) :: obj +REAL(DFP) :: avar, xij(2, 3) + +obj = ReferenceTriangle(nsd=2_I4B) +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceTriangle(nsd=2_I4B, domainName="UNIT") +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceTriangle(nsd=2_I4B, domainName="BIUNIT") +CALL OK(obj%domainName .EQ. "BIUNIT", "tests: ") + +obj = ReferenceTriangle(nsd=2_I4B, xij=RefCoord_Triangle("UNIT") ) +CALL OK(obj%domainName .EQ. "UNIT", "tests: ") + +obj = ReferenceTriangle(nsd=2_I4B, xij=RefCoord_Triangle("BIUNIT") ) +CALL OK(obj%domainName .EQ. "BIUNIT", "tests: ") + +obj = ReferenceTriangle(nsd=2_I4B, xij=2.0_DFP*RefCoord_Triangle("BIUNIT") ) +CALL OK(obj%domainName .EQ. "GENERAL", "tests: ") +END PROGRAM main +``` diff --git a/docs/docs-api/ReferenceTriangle/examples/_TotalEntities_test_1.md b/docs/docs-api/ReferenceTriangle/examples/_TotalEntities_test_1.md new file mode 100644 index 000000000..799794e56 --- /dev/null +++ b/docs/docs-api/ReferenceTriangle/examples/_TotalEntities_test_1.md @@ -0,0 +1,16 @@ +--- +title: TotalEntities_Triangle example 1 +--- + +```fortran +PROGRAM main +USE easifemBase + +IMPLICIT NONE + +CALL Display(TotalEntities_Triangle(Triangle), "Triangle: ") +CALL Display(TotalEntities_Triangle(Triangle6), "Triangle6: ") +CALL Display(TotalEntities_Triangle(Triangle10), "Triangle10: ") + +END PROGRAM main +``` diff --git a/docs/guides/install/_include/install-system-requirements.md b/docs/guides/install/_include/install-system-requirements.md index 564a09f52..170dcd355 100644 --- a/docs/guides/install/_include/install-system-requirements.md +++ b/docs/guides/install/_include/install-system-requirements.md @@ -25,10 +25,10 @@ First install `yay` on Arch Linux by following process. ```bash sudo pacman -Syu -sudo pacman -S base-devel -sudo pacman -S git +sudo pacman -Sy base-devel +sudo pacman -Sy git mkdir -pv ~/temp -sudo git clone https://aur.archlinux.org/yay.git ~/temp/yay +git clone https://aur.archlinux.org/yay.git ~/temp/yay cd ~/temp/yay makepkg -si cd ~ && rm -rf ~/temp/yay @@ -38,7 +38,17 @@ yay --version After successfully installing `yay` we can install the system dependencies by using following command. ```bash -yay -S gcc gcc-fortran openmp curl git python3 cmake ninja lapack openblas hdf5 plplot gnuplot doxygen gtk4 lua +yay -Sy gcc gcc-fortran openmp curl git python3 cmake ninja lapack openblas hdf5 plplot gnuplot doxygen gtk4 lua +``` + +If you face any problem installing plplot with fortran binding, then follow the instruction given below. + +```bash +mkdir -pv ~/temp +cd ~/temp +git clone https://github.com/easifem/archlinux-plplot-fortran.git +cd archlinux-plplot-fortran +makepkg -si ```