Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 506 - Addressing comments on previous few commits #510

Open
wants to merge 43 commits into
base: issue-390
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5a1ca04
Add function to access field of a medium
icui Feb 7, 2025
9f269ef
Made mesh/materials templated with dimension
lsawade Feb 18, 2025
d22804b
Working boolean array reading
lsawade Feb 20, 2025
7fa5c7d
added html_baseurl to conf.py
int-ptr-ptr Feb 20, 2025
0edded2
docs/requirements.txt: sphinx 8.0.0
int-ptr-ptr Feb 20, 2025
cee4707
Wokring reading of the mass matrix and the materials
lsawade Feb 20, 2025
dafe52c
Implemented absorbing boundary read
lsawade Feb 20, 2025
6a6ede0
Forgot to add the absorbing boundary header
lsawade Feb 21, 2025
e1e98bc
Refactor of the reading function using wrappers for the try catch blocks
lsawade Feb 21, 2025
fee63b1
Added Free surface
lsawade Feb 21, 2025
80fd23b
Implemented holder for coupled interfaces and reading thereof
lsawade Feb 21, 2025
d9634f3
Updated the last unexpected output for the release version
lsawade Feb 21, 2025
2ef4f67
Added boundaries file
lsawade Feb 21, 2025
8ef9441
Merge branch 'issue-502' into issue-504
lsawade Feb 21, 2025
561ce2d
Merge pull request #497 from int-ptr-ptr:readthedocs-buildfix
Rohit-Kakodkar Feb 24, 2025
2d6fb85
Merge pull request #459 from PrincetonUniversity/issue-458
icui Feb 24, 2025
67f5a51
Merge branch 'devel' into issue-504
lsawade Feb 24, 2025
f91ecba
Updated the template for read_array
lsawade Feb 24, 2025
4e18926
Made read_index_array templated by viewtype
lsawade Feb 24, 2025
81e3b19
Updated Documentation for the some of the structs and in particular t…
lsawade Feb 24, 2025
0e88671
Slightly updated how the build folder structure to not have a clutter…
lsawade Feb 24, 2025
fdcf7ad
Added some more documentation for the 2D mesh
lsawade Feb 24, 2025
454baca
Forgot to add some files whoopsie...
lsawade Feb 24, 2025
2210d38
Fixed the parameter_documentation file, there was no rhyme or reason …
lsawade Feb 24, 2025
c004e2d
Fixed some docs
lsawade Feb 24, 2025
e539946
Made parameter documentation nested
lsawade Feb 25, 2025
4cbf45d
Edited the parameter label so that it aligns with standard sphinx par…
lsawade Feb 25, 2025
8b3f023
Forgot to add sphinx_design to the the docs/requirements
lsawade Feb 25, 2025
03e1fd1
Finally happy with the simulation setup.
lsawade Feb 25, 2025
3d3d39c
Updated coupled interfaces documentation
lsawade Feb 25, 2025
0abb953
Collapsible parameter documentation is working now adding the remaini…
lsawade Feb 25, 2025
b2f3b8b
Final version of the parameter file is done
lsawade Feb 25, 2025
951328b
Removed remnants of the previous parameter description
lsawade Feb 25, 2025
5bf5919
Added documentation for parameters, partial derivatives, mass_matrix,…
lsawade Feb 25, 2025
b4a53fc
Fixed adjusted templating
lsawade Feb 25, 2025
3af4632
Update the parallel_reduces to use the specfem host abastractions
lsawade Feb 25, 2025
0dee5ec
Fix typo in impl_store_on_device.
icui Feb 26, 2025
a2b81db
Merge pull request #515 from PrincetonUniversity/issue-514
icui Feb 26, 2025
ad4bcb6
Updated fortran save_databases to write integer arrays and element_ty…
lsawade Feb 26, 2025
5ef01db
Implemented the printing for both mapping and coordinates
lsawade Feb 26, 2025
3ba3e47
Updated printing
lsawade Feb 26, 2025
afd53c0
Fixed and updated mesh print
lsawade Feb 26, 2025
95c8c35
Merge branch 'devel' into issue-506
lsawade Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ add_library(
src/IO/mesh/impl/fortran/dim3/read_parameters.cpp
src/IO/mesh/impl/fortran/dim3/read_coordinates.cpp
src/IO/mesh/impl/fortran/dim3/read_partial_derivatives.cpp
src/IO/mesh/impl/fortran/dim3/utilities.cpp
)

if (NOT HDF5_CXX_BUILD)
Expand Down Expand Up @@ -350,15 +351,22 @@ add_library(
src/mesh/dim2/tags/tags.cpp
# 3-D
src/mesh/dim3/mesh.cpp
src/mesh/dim3/boundaries/absorbing_boundary.cpp
src/mesh/dim3/boundaries/free_surface.cpp
src/mesh/dim3/coupled_interfaces/coupled_interfaces.cpp
src/mesh/dim3/element_types/element_types.cpp
src/mesh/dim3/parameters/parameters.cpp
src/mesh/dim3/parameters/parameters.cpp
src/mesh/dim3/mapping/mapping.cpp
src/mesh/dim3/materials/materials.cpp
src/mesh/dim3/coordinates/coordinates.cpp
src/mesh/dim3/partial_derivatives/partial_derivatives.cpp

)

target_link_libraries(
mesh
enumerations
Kokkos::kokkos
specfem_mpi
# material_class
Expand Down
10 changes: 5 additions & 5 deletions docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ NUM_PROC_THREADS = 1
# normally produced when WARNINGS is set to YES.
# The default value is: NO.

EXTRACT_ALL = NO
EXTRACT_ALL = YES

# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation.
Expand Down Expand Up @@ -741,7 +741,7 @@ GENERATE_DEPRECATEDLIST= YES
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
# ... \endcond blocks.

ENABLED_SECTIONS =
ENABLED_SECTIONS = NO

# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
# initial value of a variable or macro / define can have for it to appear in the
Expand Down Expand Up @@ -1222,15 +1222,15 @@ IGNORE_PREFIX =
# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
# The default value is: YES.

GENERATE_HTML = YES
GENERATE_HTML = NO

# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_OUTPUT = html
HTML_OUTPUT = "doxygen/html_doxygen"

# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
Expand Down Expand Up @@ -2146,7 +2146,7 @@ GENERATE_XML = YES
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.

XML_OUTPUT = xml
XML_OUTPUT = doxygen/xml

# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
# listings (including syntax highlighting and cross-referencing information) to
Expand Down
2 changes: 1 addition & 1 deletion docs/api/IO/fortran_io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Fortran IO

Fortran IO namespace provides a functions to read data stored in unformatted fortran binary files.

.. doxygenfunction:: specfem::fortran_IO::fortran_read_line
.. doxygenfunction:: specfem::IO::fortran_read_line
39 changes: 37 additions & 2 deletions docs/api/IO/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ are exposed through the following modules:
reader/index


Read Mesh
---------
Input for the 2D Solver
+++++++++++++++++++++++

Read the 2D Mesh
----------------

.. doxygenfunction:: specfem::IO::read_2d_mesh

Expand All @@ -45,3 +48,35 @@ Read Receivers
--------------

.. doxygenfunction:: specfem::IO::read_receivers(const std::string stations_file, const type_real angle)




Input for the 3D Solver
+++++++++++++++++++++++


Read the 3D Mesh
----------------

.. doxygenfunction:: specfem::IO::read_3d_mesh


Helper functions
''''''''''''''''

**Reading any values**

.. doxygenfunction:: specfem::IO::mesh::impl::fortran::dim3::try_read_line

**Reading any array**

.. doxygenfunction:: specfem::IO::mesh::impl::fortran::dim3::try_read_array

.. doxygenfunction:: specfem::IO::mesh::impl::fortran::dim3::read_array

**Reading index arrays**

.. doxygenfunction:: specfem::IO::mesh::impl::fortran::dim3::try_read_index_array

.. doxygenfunction:: specfem::IO::mesh::impl::fortran::dim3::read_index_array
2 changes: 1 addition & 1 deletion docs/api/enumerations/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _enumerations::
.. _enumerations:

Enumerations
============
Expand Down
2 changes: 1 addition & 1 deletion docs/api/medium/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _medium::
.. _medium:

Medium modules
==============
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Coupled Interfaces
==================

.. doxygenstruct:: specfem::mesh::coupled_interfaces
.. doxygenstruct:: specfem::mesh::coupled_interfaces< specfem::dimension::type::dim2 >
:members:


Expand Down
18 changes: 18 additions & 0 deletions docs/api/mesh/dim2/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

.. _mesh_2D:

SPECFEM++ 2D Mesh
=================

.. doxygenstruct:: specfem::mesh::mesh< specfem::dimension::type::dim2 >
:members:


.. toctree::
:maxdepth: 1

boundaries/index
control_nodes/index
coupled_interfaces/index
materials/index
tags/index
File renamed without changes.
23 changes: 23 additions & 0 deletions docs/api/mesh/dim3/boundaries/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.. _mesh_boundaries_3D:

Boundaries
++++++++++


.. doxygenstruct:: specfem::mesh::boundaries< specfem::dimension::type::dim3 >
:members:

Absorbing Boundaries
====================

.. doxygenstruct:: specfem::mesh::absorbing_boundary< specfem::dimension::type::dim3 >
:members:



Free surface boundary
=====================

.. doxygenstruct:: specfem::mesh::free_surface< specfem::dimension::type::dim3 >
:members:
7 changes: 7 additions & 0 deletions docs/api/mesh/dim3/coordinates/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _mesh_coordinates_3D:

Coordinates
+++++++++++

.. doxygenstruct:: specfem::mesh::coordinates< specfem::dimension::type::dim3 >
:members:
8 changes: 8 additions & 0 deletions docs/api/mesh/dim3/coupled_interfaces/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. mesh_3D_coupled_interfaces:

Coupled Interfaces
==================


.. doxygenstruct:: specfem::mesh::coupled_interfaces< specfem::dimension::type::dim3 >
:members:
7 changes: 7 additions & 0 deletions docs/api/mesh/dim3/element_types/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. mesh_3D_element_types:

Element Types
=============

.. doxygenstruct:: specfem::mesh::element_types< specfem::dimension::type::dim3 >
:members:
25 changes: 25 additions & 0 deletions docs/api/mesh/dim3/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

.. _mesh_3D:

SPECFEM++ 3D Mesh
=================

.. doxygenstruct:: specfem::mesh::mesh< specfem::dimension::type::dim3 >
:members:


What the 3D mesh struct holds
-----------------------------

.. toctree::
:maxdepth: 1

parameters/index
coordinates/index
mapping/index
partial_derivatives/index
element_types/index
materials/index
mass_matrix/index
boundaries/index
coupled_interfaces/index
7 changes: 7 additions & 0 deletions docs/api/mesh/dim3/mapping/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. mesh_3D_mapping:

Mapping
=======

.. doxygenstruct:: specfem::mesh::mapping< specfem::dimension::type::dim3 >
:members:
7 changes: 7 additions & 0 deletions docs/api/mesh/dim3/mass_matrix/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. mesh_3D_mass_matrix:

Matrix
======

.. doxygenstruct:: specfem::mesh::mass_matrix< specfem::dimension::type::dim3 >
:members:
7 changes: 7 additions & 0 deletions docs/api/mesh/dim3/materials/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. mesh_3D_materials:

Material
========

.. doxygenstruct:: specfem::mesh::materials< specfem::dimension::type::dim3 >
:members:
7 changes: 7 additions & 0 deletions docs/api/mesh/dim3/parameters/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. mesh_3D_parameters:

Parameters
==========

.. doxygenstruct:: specfem::mesh::parameters< specfem::dimension::type::dim3 >
:members:
7 changes: 7 additions & 0 deletions docs/api/mesh/dim3/partial_derivatives/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. mesh_3D_partial_derivatives:

Partial Derivatives
===================

.. doxygenstruct:: specfem::mesh::partial_derivatives< specfem::dimension::type::dim3 >
:members:
7 changes: 2 additions & 5 deletions docs/api/mesh/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ SPECFEM++ Mesh
.. toctree::
:maxdepth: 1

boundaries/index
control_nodes/index
coupled_interfaces/index
materials/index
tags/index
dim2/index
dim3/index
32 changes: 29 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,31 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import subprocess
import sys
import os

# Doxygen
subprocess.call("doxygen Doxyfile.in", shell=True)
doxygen_cmd = "doxygen Doxyfile.in" # or Doxyfile.in if that's the correct filename

# Create the doxygen subdirectory if it doesn't exist
if os.path.exists("_build/doxygen") is False:
os.makedirs("_build/doxygen")

if os.environ.get("NODOXYGEN") is not None:
print("Skipping Doxygen build as NODOXYGEN environment variable is set")
result = 0
else:
result = subprocess.call(doxygen_cmd, shell=True)

if result != 0:
print(f"Error: Doxygen command '{doxygen_cmd}' failed with code {result}")
sys.exit(1)

# Check if output directory exists
if not os.path.exists("_build/doxygen/xml"):
print("Error: Doxygen XML output directory '_build/doxygen/xml' not found")
print("Please check Doxygen configuration and make sure it runs correctly")
sys.exit(1)

# -- Project information -----------------------------------------------------

Expand All @@ -42,10 +64,14 @@
"sphinx.ext.viewcode",
"sphinx_sitemap",
"sphinx.ext.inheritance_diagram",
"sphinx_design",
"breathe",
"sphinx_copybutton",
]

# Adding this to avoid the WARNING: duplicate label warning
autosectionlabel_prefix_document = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -78,7 +104,7 @@
# }
# html_logo = ''
github_url = "https://github.com/PrincetonUniversity/SPECFEMPP"
# html_baseurl = ''
html_baseurl = "https://specfem2d-kokkos.readthedocs.io/"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand All @@ -96,6 +122,6 @@

# -- Breathe configuration -------------------------------------------------

breathe_projects = {"SPECFEM KOKKOS IMPLEMENTATION": "_build/xml"}
breathe_projects = {"SPECFEM KOKKOS IMPLEMENTATION": "_build/doxygen/xml"}
breathe_default_project = "SPECFEM KOKKOS IMPLEMENTATION"
breathe_default_members = ()
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Defining sources

Now that we have the mesh and receiver locations, we can define the sources. We will use the following source file to define the sources.

.. code:: yaml
.. code-block:: yaml
:caption: sources.yaml

number-of-sources: 1
Expand All @@ -189,6 +189,8 @@ Now that we have the mesh and receiver locations, we can define the sources. We
tshift: 0.0
f0: 10.0



Final mesh
----------

Expand Down
Loading