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

anisotropic diffusion and constraints don't mix #236

Closed
guyer opened this issue Sep 19, 2014 · 2 comments
Closed

anisotropic diffusion and constraints don't mix #236

guyer opened this issue Sep 19, 2014 · 2 comments

Comments

@guyer
Copy link
Member

guyer commented Sep 19, 2014

When a DiffusionTerm has an anisotropic diffusion coefficient and constraints have been applied to the solution CellVariable, an error is raised:

Traceback (most recent call last):
  File "examples/diffusion/steadyState/mesh20x20/isotropy.py", line 71, in <module>
exec(fipy.tests.doctestPlus._getScript())
  File "<string>", line 22, in <module>
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/terms/term.py", line 192, in solve
solver = self._prepareLinearSystem(var, solver, boundaryConditions, dt)
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/terms/term.py", line 154, in _prepareLinearSystem
buildExplicitIfOther=self._buildExplcitIfOther)
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/terms/unaryTerm.py", line 87, in _buildAndAddMatrices
diffusionGeomCoeff=diffusionGeomCoeff)
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/terms/baseDiffusionTerm.py", line 245, in _buildMatrix
self.constraintB -= (constrainedNormalsDotCoeffOverdAP * var.arithmeticFaceValue).divergence * mesh.cellVolumes
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/variables/variable.py", line 1076, in __mul__
return self._BinaryOperatorVariable(lambda a,b: a*b, other)
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/variables/variable.py", line 1041, in _BinaryOperatorVariable
if not v.unit.isDimensionless():
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/variables/variable.py", line 256, in _getUnit
return self._extractUnit(self.value)
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/variables/variable.py", line 503, in _getValue
value = self._calcValue()
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/variables/addOverFacesVariable.py", line 89, in _calcValue
contributions = numerix.take(self.faceVariable, ids)
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/tools/numerix.py", line 511, in take
taken = a.take(indices, axis=axis)   
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/variables/variable.py", line 1504, in take
return numerix.take(self.value, ids, axis)
  File "/Users/guyer/Documents/research/FiPy/trunk-clean/fipy/tools/numerix.py", line 535, in take
taken = NUMERIX.take(a, indices, axis=axis)
  File "/Users/guyer/.virtualenvs/variableMeshes/lib/python2.6/site-packages/numpy/core/fromnumeric.py", line 103, in take
return take(indices, axis, out, mode)
IndexError: index out of range for array

Imported from trac ticket #332, created by guyer on 04-22-2011 at 09:33, last modified: 05-02-2011 at 16:30

@guyer
Copy link
Member Author

guyer commented Sep 19, 2014

See trunk/examples/diffusion/steadyState/mesh20x20/isotropy.py@4483

Trac comment by guyer on 04-22-2011 at 09:35

@wd15
Copy link
Contributor

wd15 commented Sep 19, 2014

Both anisotropy.py and isotropy.py tests pass. Fixed with r4519.

Trac comment by wd15 on 05-02-2011 at 16:30

@guyer guyer closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants