Skip to content

Commit

Permalink
Documentation Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thivinanandh committed May 9, 2024
1 parent 7619891 commit fd4199a
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 66 deletions.
19 changes: 10 additions & 9 deletions docs/_rst/_installation.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation
============

The build of the code is currently tested on Python 3.8, 3.9, 3.10 and 3.11. The code is CI tested on enviroinments provided by Github Actions such as `ubuntu-20.04`, `ubuntu-latest`, `macos-latest`,`windows-latest` ,
The build of the code is currently tested on Python 3.8, 3.9, 3.10 and 3.11. The code is CI tested on environments provided by Github Actions such as `ubuntu-20.04`, `ubuntu-latest`, `macos-latest`, `windows-latest`,
refer to `Compatibility-CI <https://github.com/cmgcds/fastvpinns/actions/workflows/integration-tests.yml>`_ page for more details.

Setting up an Virtual Environment
Expand All @@ -11,15 +11,15 @@ It is recommended to create a virtual environment to install the package. You ca

.. code-block:: bash
$ python3 -m venv venv
$ source venv/bin/activate
python3 -m venv venv
source venv/bin/activate
For conda users, you can create a virtual environment using the following command:

.. code-block:: bash
$ conda create -n fastvpinns python=3.8
$ conda activate fastvpinns
conda create -n fastvpinns python=3.8
conda activate fastvpinns
Installing via PIP
Expand All @@ -29,13 +29,13 @@ You can simply install the package using pip as follows:

.. code-block:: bash
$ pip install fastvpinns
pip install fastvpinns
On ubuntu/mac systems with libGL issues caused due to matplotlib or gmsh, please run the following command to install the required dependencies.

.. code-block:: bash
$ sudo apt-get install libgl1-mesa-glx
sudo apt-get install libgl1-mesa-glx
Installing from source
Expand All @@ -45,10 +45,11 @@ The official distribution is on GitHub, and you can clone the repository using

.. code-block:: bash
$ git clone https://github.com/cmgcds/fastvpinns.git
git clone https://github.com/cmgcds/fastvpinns.git
To install the package just type:

.. code-block:: bash
$ pip install -e .
cd fastvpinns
pip install -e .
2 changes: 1 addition & 1 deletion docs/_rst/_team.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ FastVPINNs is currently developed by `Thivin Anandh <https://github.com/thivinan
under supervision of `Prof. Sashikumaar Ganesan <http://cds.iisc.ac.in/faculty/sashi/>`_ at `STARS LAB, Indian Institute of Science, Bangalore <https://cmg.cds.iisc.ac.in/>`_.


The Authors would like to acknowkedge the support of Shell Technology Centre, India for their partial funding, We are thankful to the MHRD Grant No. STARS-1/388 (SPADE)
The Authors would like to acknowledge the support of Shell Technology Centre, India for their partial funding, We are thankful to the MHRD Grant No. STARS-1/388 (SPADE)
for partial support.
1 change: 0 additions & 1 deletion docs/_rst/fastvpinns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ Finite Element Setup
:maxdepth: 2
:titlesonly:

Fespace(Abstract) <library/fe2d/fe2d_fespace.rst>
Fespace2D <library/fe2d/fe2d_fespace2d.rst>
FE2DSetupMain <library/fe2d/fe2d_fe2d_setup.rst>
FE2DCell <library/fe2d/fe2d_fe2d_cell.rst>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Convection Diffusion 2D Example on Circular Domain


This example demonstrates how to solve a Poisson equation in 2D on a circular domain using the ``fastvpinns`` package.
All the necesary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
All the necessary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_

The Poisson equation is given by

Expand Down Expand Up @@ -301,7 +301,7 @@ special type of Jacobi polynomials defined by

.. math:: J_{n} = J_{n-1} - J_{n+1}

, where $J_{n} is the nth Jacobi polynomial.
, where J :sub:`n` is the nth Jacobi polynomial.

`Return to top <#contents>`__

Expand Down Expand Up @@ -596,7 +596,7 @@ Initialise the ``DataHandler`` class with the required parameters.
Setup model
^^^^^^^^^^^

Setup the necesary parameters for the model and initialise the ``Model``
Setup the necessary parameters for the model and initialise the ``Model``
class. Before that fill the ``params`` dictionary with the required
parameters.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Convection-Diffusion 2D Example on Circular Domain

This example demonstrates how to solve a Poisson equation in 2D on a
circular domain using the ``fastvpinns`` package.
All the necesary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
All the necessary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
The Poisson equation is given by

.. math:: -\epsilon \nabla^2 u + \mathbf{b} \cdot \nabla u + cu = f \quad \text{in} \quad \Omega
Expand Down Expand Up @@ -308,7 +308,7 @@ special type of Jacobi polynomials defined by

.. math:: J_{n} = J_{n-1} - J_{n+1}

, where $J_{n} is the nth Jacobi polynomial.
, where J :sub:`n` is the nth Jacobi polynomial.

`Return to top <#contents>`__

Expand Down Expand Up @@ -597,7 +597,7 @@ Initialise the ``DataHandler`` class with the required parameters.
Setup model
^^^^^^^^^^^

Setup the necesary parameters for the model and initialise the ``Model``
Setup the necessary parameters for the model and initialise the ``Model``
class. Before that fill the ``params`` dictionary with the required
parameters.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Helmholtz 2D Example on Circular Domain

This example demonstrates how to solve a Poisson equation in 2D on a
circular domain using the ``fastvpinns`` package.
All the necesary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
All the necessary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_

The Poisson equation is given by

Expand Down Expand Up @@ -305,7 +305,7 @@ special type of Jacobi polynomials defined by

.. math:: J_{n} = J_{n-1} - J_{n+1}

, where $J_{n} is the nth Jacobi polynomial.
, where J :sub:`n` is the nth Jacobi polynomial.

`Return to top <#contents>`__

Expand Down Expand Up @@ -596,7 +596,7 @@ Initialise the ``DataHandler`` class with the required parameters.
Setup model
^^^^^^^^^^^

Setup the necesary parameters for the model and initialise the ``Model``
Setup the necessary parameters for the model and initialise the ``Model``
class. Before that fill the ``params`` dictionary with the required
parameters.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Poisson 2D Example on Circular Domain

This example demonstrates how to solve a Poisson equation in 2D on a
circular domain using the ``fastvpinns`` package.
All the necesary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
All the necessary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_

The Poisson equation is given by

Expand Down Expand Up @@ -33,8 +33,6 @@ The computational domain is a circular domain with radius 1 centered at
.. figure:: mesh.png
:alt: alt text

alt text

Contents
-----------

Expand Down Expand Up @@ -307,7 +305,7 @@ special type of Jacobi polynomials defined by

.. math:: J_{n} = J_{n-1} - J_{n+1}

, where $J_{n} is the nth Jacobi polynomial.
, where J :sub:`n` is the nth Jacobi polynomial.

`Return to top <#contents>`__

Expand Down Expand Up @@ -597,7 +595,7 @@ Initialise the ``DataHandler`` class with the required parameters.
Setup model
^^^^^^^^^^^

Setup the necesary parameters for the model and initialise the ``Model``
Setup the necessary parameters for the model and initialise the ``Model``
class. Before that fill the ``params`` dictionary with the required
parameters.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Solving forward problems with FastVPINNs : Enforcing hard boundary constraints w
=======================================================================================================

In this example, we will learn how to use hard boundary constraints using FastVPINNs.
All the necesary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
All the necessary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_

.. math::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Solving forward problems with FastVPINNs : Helmholtz - 2D
=========================================================

In this example, we will learn to solve the Helmholtz equation in 2D
All the necesary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
All the necessary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_

.. math::
Expand All @@ -13,8 +13,8 @@ where
.. math::
f(x,y) = 2 \pi cos(\pi y)sin(\pi x) + 2 \pi cos(\pi x) sin(\pi y)
+ (x+y) sin(\pi x) sin(\pi y) - 2 \pi^2 (x+y) sin(\pi x) sin(\pi y),
f(x,y) = 2 \pi cos(\pi y)sin(\pi x) + 2 \pi cos(\pi x) sin(\pi y) + (x+y) sin(\pi x) sin(\pi y) - \\
2 \pi^2 (x+y) sin(\pi x) sin(\pi y),
For this problem, the parameters are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Solving forward problems with FastVPINNs : Poisson - 2D
=======================================================

In this example, we will learn how to solve a 2-dimensional Poisson problem using FastVPINNs.
All the necesary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_
All the necessary files can be found in the examples folder of the `fastvpinns GitHub repository <https://github.com/cmgcds/fastvpinns>`_

.. math::
Expand Down Expand Up @@ -124,7 +124,7 @@ The input file, ``input.yaml``, is used to define inputs to your solver.
These will usually parameters that will changed often throughout your
experimentation, hence it is best practice to pass these parameters
externally. The input file is divided based on the modules which use the
parameter in question, as follows - ### ``experimentation`` This
parameter in question, as follows - ``experimentation`` This
contains ``output_path``, a string which specifies which folder will be
used to store your outputs.

Expand Down Expand Up @@ -346,8 +346,8 @@ PDE.
`Back to contents <#contents>`__

## Solution
-----------
Solution
--------
.. image:: exact_solution.png
:alt: Exact Solution
:align: center
Expand All @@ -365,8 +365,8 @@ PDE.

`Back to contents <#contents>`__

## References
-------------
References
----------

1. `FastVPINNs: Tensor-Driven Acceleration of VPINNs for Complex
Geometries. <https://arxiv.org/abs/2404.12063>`__
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ actual value of the parameter that needs to be estimated (if the error
between the actual and estimated parameter needs to be calculated) ###
Defining boundary values The current version of FastVPINNs only
implements Dirichlet boundary conditions. The boundary values can be set
defining a function for each boundary,
by defining a function for each boundary,

.. code:: python
Expand Down Expand Up @@ -431,12 +431,6 @@ Solution

Error

.. figure:: sensor_points.png
:alt: Sensor points
:align: center

Sensor points

.. figure:: inverse_eps_prediction.png
:alt: inverse_eps_prediction
:align: center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Defining boundary values

The current version of FastVPINNs only
implements Dirichlet boundary conditions. The boundary values can be set
defining a function for each boundary,
by defining a function for each boundary,

.. code:: python
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Welcome to FastVPINNs's documentation!
A robust tensor-based deep learning framework for solving PDE's using hp-Variational Physics-Informed Neural Networks (hp-VPINNs). The framework supports handling complex geometries and uses tensor-based loss computation to accelerate the training of conventional hp-VPINNs.
The framework is based on the work by `FastVPINNs Paper <https://arxiv.org/abs/2404.12063>`_. The framework is written on `Tensorflow 2.0 <https://www.tensorflow.org/>`_ and has support for handling external meshes.

*Note: This framework is an highly optimised version of the the initial implementation of hp-VPINNs by* `kharazmi <https://github.com/ehsankharazmi/hp-VPINNs>`_. Ref `hp-VPINNs(arXiv) <https://arxiv.org/abs/2003.05385>`_.
*Note: This framework is a highly optimised version of the the initial implementation of hp-VPINNs by* `kharazmi <https://github.com/ehsankharazmi/hp-VPINNs>`_. Ref `hp-VPINNs(arXiv) <https://arxiv.org/abs/2003.05385>`_.

Variational Physics-informed neural network
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
10 changes: 5 additions & 5 deletions fastvpinns/FE/fe_transformation_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self):
@abstractmethod
def set_cell(self):
"""
Set the cell co-ordinates, which will be used to calculate the Jacobian and actual values.
Set the cell coordinates, which will be used to calculate the Jacobian and actual values.
:return: None
"""
Expand All @@ -56,13 +56,13 @@ def get_original_from_ref(self, xi, eta):
@abstractmethod
def get_original_from_ref(self, xi, eta):
"""
This method returns the original co-ordinates from the reference co-ordinates.
This method returns the original coordinates from the reference coordinates.
:param xi: The xi value of the reference co-ordinates.
:param xi: The xi value of the reference coordinates.
:type xi: float
:param eta: The eta value of the reference co-ordinates.
:param eta: The eta value of the reference coordinates.
:type eta: float
:return: The original co-ordinates corresponding to the given reference co-ordinates.
:return: The original coordinates corresponding to the given reference coordinates.
:rtype: tuple
"""

Expand Down
16 changes: 8 additions & 8 deletions fastvpinns/FE/quad_affine.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, co_ordinates) -> None:

def set_cell(self):
"""
Set the cell co-ordinates, which will be used to calculate the Jacobian and actual values.
Set the cell coordinates, which will be used to calculate the Jacobian and actual values.
:param None:
There are no parameters for this method.
Expand All @@ -49,7 +49,7 @@ def set_cell(self):
self.x2 = self.co_ordinates[2][0]
self.x3 = self.co_ordinates[3][0]

# get the y-co-ordinates of the cell
# get the y-coordinates of the cell
self.y0 = self.co_ordinates[0][1]
self.y1 = self.co_ordinates[1][1]
self.y2 = self.co_ordinates[2][1]
Expand All @@ -65,12 +65,12 @@ def set_cell(self):

def get_original_from_ref(self, xi, eta):
"""
Returns the original co-ordinates from the reference co-ordinates.
Returns the original coordinates from the reference coordinates.
:param float xi: The xi coordinate.
:param float eta: The eta coordinate.
:return: numpy.ndarray
The original co-ordinates.
The original coordinates.
"""
x = self.xc0 + self.xc1 * xi + self.xc2 * eta
y = self.yc0 + self.yc1 * xi + self.yc2 * eta
Expand All @@ -96,7 +96,7 @@ def get_jacobian(self, xi, eta):

def get_orig_from_ref_derivative(self, ref_gradx, ref_grady, xi, eta):
"""
Returns the derivatives of the original co-ordinates with respect to the reference co-ordinates.
Returns the derivatives of the original coordinates with respect to the reference coordinates.
:param ref_gradx: The reference gradient in the x-direction.
:type ref_gradx: numpy.ndarray
Expand All @@ -107,7 +107,7 @@ def get_orig_from_ref_derivative(self, ref_gradx, ref_grady, xi, eta):
:param eta: The eta coordinate.
:type eta: float
:return: The derivatives of the original co-ordinates with respect to the reference co-ordinates.
:return: The derivatives of the original coordinates with respect to the reference coordinates.
:rtype: tuple
"""
gradx_orig = np.zeros(ref_gradx.shape)
Expand All @@ -121,7 +121,7 @@ def get_orig_from_ref_derivative(self, ref_gradx, ref_grady, xi, eta):

def get_orig_from_ref_second_derivative(self, grad_xx_ref, grad_xy_ref, grad_yy_ref, xi, eta):
"""
Returns the second derivatives (xx, xy, yy) of the original co-ordinates with respect to the reference co-ordinates.
Returns the second derivatives (xx, xy, yy) of the original coordinates with respect to the reference coordinates.
:param grad_xx_ref: The reference second derivative in the xx-direction.
:type grad_xx_ref: numpy.ndarray
Expand All @@ -134,7 +134,7 @@ def get_orig_from_ref_second_derivative(self, grad_xx_ref, grad_xy_ref, grad_yy_
:param eta: The eta coordinate.
:type eta: float
:return: The second derivatives (xx, xy, yy) of the original co-ordinates with respect to the reference co-ordinates.
:return: The second derivatives (xx, xy, yy) of the original coordinates with respect to the reference coordinates.
:rtype: tuple
"""
GeoData = np.zeros((3, 3))
Expand Down
Loading

0 comments on commit fd4199a

Please sign in to comment.