diff --git a/.travis.yml b/.travis.yml index dac2c6af..e31b94e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: # Setup anaconda before_install: - - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-3.3.0-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.3.0-Linux-x86_64.sh -O miniconda.sh; fi + - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.8.3-Linux-x86_64.sh -O miniconda.sh; fi - chmod +x miniconda.sh - ./miniconda.sh -b - export PATH=/home/travis/anaconda/bin:/home/travis/miniconda/bin:$PATH diff --git a/SimPEG/Maps.py b/SimPEG/Maps.py index 4ab1d855..0b47de66 100644 --- a/SimPEG/Maps.py +++ b/SimPEG/Maps.py @@ -229,16 +229,16 @@ class LogMap(IdentityMap): ..math:: - p = \\log(m) + p = \\log(m) - and + and ..math:: m = \\exp(p) NOTE: If you have a model which is log conductivity (ie. \\(m = \\log(\\sigma)\\)), - you should be using an ExpMap + you should be using an ExpMap """ diff --git a/SimPEG/Mesh/CylMesh.py b/SimPEG/Mesh/CylMesh.py index 93cd5451..8d2b1ae8 100644 --- a/SimPEG/Mesh/CylMesh.py +++ b/SimPEG/Mesh/CylMesh.py @@ -11,6 +11,10 @@ class CylMesh(BaseTensorMesh, InnerProducts, CylView): """ CylMesh is a mesh class for cylindrical problems + .. note:: + + for a cylindrically symmetric mesh use [hx, 1, hz] + :: cs, nc, npad = 20., 30, 8 @@ -25,8 +29,10 @@ class CylMesh(BaseTensorMesh, InnerProducts, CylView): def __init__(self, h, x0=None): BaseTensorMesh.__init__(self, h, x0) - assert self.dim == 3, "dim of mesh must equal 3, for a cylindrically symmetric mesh use [hx, 1, hz]" assert self.hy.sum() == 2*np.pi, "The 2nd dimension must sum to 2*pi" + if self.dim == 2: + print 'Warning, a disk mesh has not been tested thoroughly.' + @property def isSymmetric(self): @@ -278,6 +284,18 @@ class CylMesh(BaseTensorMesh, InnerProducts, CylView): # kron3(speye(n[2]), av(n[1]), av(n[0]))), format="csr") return self._aveE2CC + @property + def aveE2CCV(self): + "Construct the averaging operator on cell edges to cell centers." + if getattr(self, '_aveE2CCV', None) is None: + # The number of cell centers in each direction + n = self.vnC + if self.isSymmetric: + return self.aveE2CC + else: + raise NotImplementedError('wrapping in the averaging is not yet implemented') + return self._aveE2CCV + @property def aveF2CC(self): @@ -295,6 +313,20 @@ class CylMesh(BaseTensorMesh, InnerProducts, CylView): # kron3(av(n[2]), speye(n[1]), speye(n[0]))), format="csr") return self._aveF2CC + @property + def aveF2CCV(self): + "Construct the averaging operator on cell faces to cell centers." + if getattr(self, '_aveF2CCV', None) is None: + n = self.vnC + if self.isSymmetric: + avR = av(n[0])[:,1:] + avR[0,0] = 1. + self._aveF2CCV = sp.block_diag((sp.kron(speye(n[2]), avR), + sp.kron(av(n[2]), speye(n[0]))), format="csr") + else: + raise NotImplementedError('wrapping in the averaging is not yet implemented') + return self._aveF2CCV + if __name__ == '__main__':