Beispiel #1
0
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.


import os
import warnings

import numpy as np

import solvcon as sc
from solvcon import solver
from solvcon import boundcond

# for readthedocs to work.
sc.import_module_may_fail('._algorithm')


class BulkSolver(solver.MeshSolver):
    """This class controls the underneath algorithm :py:class:`BulkAlgorithm
    <._algorithm.BulkAlgorithm>`.
    """

    _interface_init_ = ['cecnd', 'cevol', 'sfmrc']
    _solution_array_ = ['solt', 'sol', 'soln', 'dsol', 'dsoln']

    def __init__(self, blk, **kw):
        """
        >>> # create a valid solver as the test fixture.
        >>> from solvcon import testing
        >>> from . import material
Beispiel #2
0
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
"""
This is a dumb wrapper to netCDF4 Python binding.  The purpose of this module
is to provide a compatibility layer to an old wrapper to netCDF C library,
which is removed.

For more information about netCDF, please refer to 
http://www.unidata.ucar.edu/software/netcdf/index.html
"""

import numpy as np

import solvcon as sc
sc.import_module_may_fail('netCDF4')


class NetCDF(object):
    """
    Wrapper for the netCDF library by using ctypes.  Mainly designed for
    reading.  Native functions remains to be nc_*.  NC_* are class members for
    constants defined in the header file.
    """
    def __init__(self, path=None, omode="r"):
        """
        :keyword path: the file to open.
        :type path: str
        :keyword omode: opening mode.
        :type omode: int
        """
Beispiel #3
0
    'VewaveBC',
    'VewaveNonRefl',
    'VewaveLongSineX',
]

import os
import warnings

import numpy as np

import solvcon as sc
from solvcon import solver
from solvcon import boundcond

# for readthedocs to work.
sc.import_module_may_fail('._algorithm')


class VewaveSolver(solver.MeshSolver):
    """This class controls the underneath algorithm :py:class:`VewaveAlgorithm
    <._algorithm.VewaveAlgorithm>`.
    """

    _interface_init_ = ['cecnd', 'cevol']
    _solution_array_ = ['solt', 'sol', 'soln', 'dsol', 'dsoln']

    def __init__(self, blk, mtrldict, **kw):
        """
        A linear solver needs a :py:class:`Block <solvcon.block.Block>` and a
        dictionary for mapping names to :py:class:`~.material.Material`:
Beispiel #4
0
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

"""
This is a dumb wrapper to netCDF4 Python binding.  The purpose of this module
is to provide a compatibility layer to an old wrapper to netCDF C library,
which is removed.

For more information about netCDF, please refer to 
http://www.unidata.ucar.edu/software/netcdf/index.html
"""

import numpy as np

import solvcon as sc
sc.import_module_may_fail('netCDF4')

class NetCDF(object):
    """
    Wrapper for the netCDF library by using ctypes.  Mainly designed for
    reading.  Native functions remains to be nc_*.  NC_* are class members for
    constants defined in the header file.
    """

    def __init__(self, path=None, omode="r"):
        """
        :keyword path: the file to open.
        :type path: str
        :keyword omode: opening mode.
        :type omode: int
        """
Beispiel #5
0
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

"""
Gas-dynamics solver.
"""


import numpy as np

import solvcon as sc

# for readthedocs to work.
sc.import_module_may_fail("._algorithm")


class GasSolver(sc.MeshSolver):
    """
    Spatial loops for the gas-dynamics solver.
    """

    _interface_init_ = ("cecnd", "cevol", "sfmrc")
    _solution_array_ = ("solt", "sol", "soln", "dsol", "dsoln")

    def __init__(self, blk, **kw):
        """
        Create a :py:class:`._algorithm.GasAlgorithm` object.

        >>> # create a valid solver as the test fixture.