Merge branch 'develop' of https://github.com/simpeg/simpeg into boundaryConditions

This commit is contained in:
rowanc1
2014-02-26 09:17:32 -08:00
15 changed files with 145 additions and 92 deletions
+62
View File
@@ -64,6 +64,68 @@ class BaseModel(object):
m = self.example()
return checkDerivative(lambda m : [self.transform(m), self.transformDeriv(m)], m, plotIt=False)
class BaseNonLinearModel(object):
"""
SimPEG BaseNonLinearModel
"""
__metaclass__ = Utils.SimPEGMetaClass
counter = None #: A SimPEG.Utils.Counter object
mesh = None #: A SimPEG Mesh
def __init__(self, mesh):
self.mesh = mesh
def transform(self, u, m):
"""
:param numpy.array u: fields
:param numpy.array m: model
:rtype: numpy.array
:return: transformed model
The *transform* changes the model into the physical property.
"""
return m
def transformDerivU(self, u, m):
"""
:param numpy.array u: fields
:param numpy.array m: model
:rtype: scipy.csr_matrix
:return: derivative of transformed model
The *transform* changes the model into the physical property.
The *transformDerivU* provides the derivative of the *transform* with respect to the fields.
"""
raise NotImplementedError('The transformDerivU is not implemented.')
def transformDerivM(self, u, m):
"""
:param numpy.array u: fields
:param numpy.array m: model
:rtype: scipy.csr_matrix
:return: derivative of transformed model
The *transform* changes the model into the physical property.
The *transformDerivU* provides the derivative of the *transform* with respect to the model.
"""
raise NotImplementedError('The transformDerivM is not implemented.')
@property
def nP(self):
"""Number of parameters in the model."""
return self.mesh.nC
def example(self):
raise NotImplementedError('The example is not implemented.')
def test(self, m=None):
raise NotImplementedError('The test is not implemented.')
class LogModel(BaseModel):
"""SimPEG LogModel"""
+1 -1
View File
@@ -41,7 +41,7 @@ class BaseProblem(object):
dataPair = Data.BaseData
modelPair = Model.BaseModel
def __init__(self, mesh, model, *args, **kwargs):
def __init__(self, mesh, model, **kwargs):
Utils.setKwargs(self, **kwargs)
self.mesh = mesh
assert isinstance(model, self.modelPair), "Model object must be an instance of a %s class."%(self.modelPair.__name__)
-8
View File
@@ -1,8 +0,0 @@
.. _api_BaseMesh:
Base Mesh
*********
.. automodule:: SimPEG.Mesh.BaseMesh
:members:
:undoc-members:
-8
View File
@@ -1,8 +0,0 @@
.. _api_Cyl1DMesh:
Cylindrical 1D Mesh
*******************
.. automodule:: SimPEG.Mesh.Cyl1DMesh
:members:
:undoc-members:
-8
View File
@@ -1,8 +0,0 @@
.. _api_DiffOperators:
Differential Operators
**********************
.. automodule:: SimPEG.Mesh.DiffOperators
:members:
:undoc-members:
+3 -3
View File
@@ -2,7 +2,7 @@
Model
*****
=====
.. automodule:: SimPEG.Model
:show-inheritance:
@@ -11,7 +11,7 @@ Model
:inherited-members:
Data
****
====
.. automodule:: SimPEG.Data
:show-inheritance:
@@ -20,7 +20,7 @@ Data
:inherited-members:
Problem
*******
=======
.. automodule:: SimPEG.Problem
:show-inheritance:
-8
View File
@@ -1,8 +0,0 @@
.. _api_InnerProducts:
Inner Products
**************
.. automodule:: SimPEG.Mesh.InnerProducts
:members:
:undoc-members:
+4 -4
View File
@@ -2,7 +2,7 @@
Regularization
**************
==============
.. automodule:: SimPEG.Regularization
:show-inheritance:
@@ -11,7 +11,7 @@ Regularization
Objective Function
******************
==================
.. automodule:: SimPEG.ObjFunction
:members:
@@ -19,7 +19,7 @@ Objective Function
Optimize
********
========
.. automodule:: SimPEG.Optimization
:show-inheritance:
@@ -28,7 +28,7 @@ Optimize
:undoc-members:
Inversion
*********
=========
.. automodule:: SimPEG.Inversion
:show-inheritance:
-10
View File
@@ -1,10 +0,0 @@
.. _api_LogicallyOrthogonalMesh:
Logically Orthogonal Mesh
*************************
.. automodule:: SimPEG.Mesh.LogicallyOrthogonalMesh
:show-inheritance:
:members:
:undoc-members:
:inherited-members:
+53
View File
@@ -0,0 +1,53 @@
.. _api_Mesh:
Tensor Mesh
===========
.. automodule:: SimPEG.Mesh.TensorMesh
:show-inheritance:
:members:
:undoc-members:
:inherited-members:
Cylindrical 1D Mesh
===================
.. automodule:: SimPEG.Mesh.Cyl1DMesh
:members:
:undoc-members:
Logically Orthogonal Mesh
=========================
.. automodule:: SimPEG.Mesh.LogicallyOrthogonalMesh
:show-inheritance:
:members:
:undoc-members:
:inherited-members:
Base Mesh
=========
.. automodule:: SimPEG.Mesh.BaseMesh
:members:
:undoc-members:
Inner Products
==============
.. automodule:: SimPEG.Mesh.InnerProducts
:members:
:undoc-members:
Differential Operators
======================
.. automodule:: SimPEG.Mesh.DiffOperators
:members:
:undoc-members:
+1 -1
View File
@@ -2,7 +2,7 @@
Parameters
**********
==========
.. automodule:: SimPEG.Parameters
:show-inheritance:
-10
View File
@@ -1,10 +0,0 @@
.. _api_TensorMesh:
Tensor Mesh
***********
.. automodule:: SimPEG.Mesh.TensorMesh
:show-inheritance:
:members:
:undoc-members:
:inherited-members:
+1 -1
View File
@@ -1,7 +1,7 @@
.. _api_Tests:
Testing SimPEG
**************
==============
.. automodule:: SimPEG.Tests.TestUtils
:members:
+5 -12
View File
@@ -17,42 +17,35 @@ Utilities
:undoc-members:
Matrix Utilities
****************
================
.. automodule:: SimPEG.Utils.matutils
:members:
:undoc-members:
Sparse Utilities
****************
.. automodule:: SimPEG.Utils.sputils
:members:
:undoc-members:
LOM Utilities
*************
=============
.. automodule:: SimPEG.Utils.lomutils
:members:
:undoc-members:
Mesh Utilities
**************
==============
.. automodule:: SimPEG.Utils.meshutils
:members:
:undoc-members:
Model Builder Utilities
***********************
=======================
.. automodule:: SimPEG.Utils.ModelBuilder
:members:
:undoc-members:
Interpolation Utilities
***********************
=======================
.. automodule:: SimPEG.Utils.interputils
:members:
+15 -18
View File
@@ -11,10 +11,12 @@ The vision is to create a package for finite volume simulation and parameter est
applications to geophysical imaging and subsurface flow. To enable
these goals, this package has the following features:
* is modular with respect to discretization, physics, optimization, and regularization
* is built with the (large-scale) inverse problem in mind
* provides a framework for geophysical and hydrogeologic problems
* supports 1D, 2D and 3D problems
* is modular with respect to discretization, physics, optimization, and regularization
* is built with the (large-scale) inverse problem in mind
* provides a framework for geophysical and hydrogeologic problems
* supports 1D, 2D and 3D problems
.. image:: simpeg-framework.png
:width: 400 px
@@ -22,20 +24,15 @@ these goals, this package has the following features:
:align: center
Meshing & Operators
===================
*******************
.. toctree::
:maxdepth: 2
api_BaseMesh
api_TensorMesh
api_LogicallyOrthogonalMesh
api_Cyl1DMesh
api_DiffOperators
api_InnerProducts
api_Mesh
Forward Problems
================
****************
.. toctree::
:maxdepth: 2
@@ -43,7 +40,7 @@ Forward Problems
api_Forward
Inversion
=========
*********
.. toctree::
:maxdepth: 2
@@ -52,7 +49,7 @@ Inversion
api_Parameters
Testing SimPEG
==============
**************
.. toctree::
:maxdepth: 2
@@ -60,20 +57,20 @@ Testing SimPEG
api_Tests
* Master Branch
.. image:: https://travis-ci.org/simpeg/simpeg.png?branch=master
.. image:: https://travis-ci.org/simpeg/simpeg.png?branch*master
:target: https://travis-ci.org/simpeg/simpeg
:alt: Master Branch
:align: center
* Develop Branch
.. image:: https://travis-ci.org/simpeg/simpeg.png?branch=develop
.. image:: https://travis-ci.org/simpeg/simpeg.png?branch*develop
:target: https://travis-ci.org/simpeg/simpeg
:alt: Develop Branch
:align: center
Utility Codes
=============
*************
.. toctree::
:maxdepth: 2
@@ -82,7 +79,7 @@ Utility Codes
Project Index & Search
======================
**********************
* :ref:`genindex`
* :ref:`modindex`