# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.1.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _fieldindex
else:
    import _fieldindex

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import ooflib.SWIG.engine.planarity
class FieldIndex(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __swig_destroy__ = _fieldindex.delete_FieldIndex

    def integer(self):
        return _fieldindex.FieldIndex_integer(self)

    def in_plane(self):
        return _fieldindex.FieldIndex_in_plane(self)

    def shortrepr(self):
        return _fieldindex.FieldIndex_shortrepr(self)

    def __repr__(self):
        return _fieldindex.FieldIndex___repr__(self)

# Register FieldIndex in _fieldindex:
_fieldindex.FieldIndex_swigregister(FieldIndex)
class ScalarFieldIndex(FieldIndex):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self):
        _fieldindex.ScalarFieldIndex_swiginit(self, _fieldindex.new_ScalarFieldIndex())

    def __repr__(self):
        return _fieldindex.ScalarFieldIndex___repr__(self)
    __swig_destroy__ = _fieldindex.delete_ScalarFieldIndex

# Register ScalarFieldIndex in _fieldindex:
_fieldindex.ScalarFieldIndex_swigregister(ScalarFieldIndex)
class VectorFieldIndex(FieldIndex):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, arg2):
        _fieldindex.VectorFieldIndex_swiginit(self, _fieldindex.new_VectorFieldIndex(arg2))

    def __repr__(self):
        return _fieldindex.VectorFieldIndex___repr__(self)
    __swig_destroy__ = _fieldindex.delete_VectorFieldIndex

# Register VectorFieldIndex in _fieldindex:
_fieldindex.VectorFieldIndex_swigregister(VectorFieldIndex)
class OutOfPlaneVectorFieldIndex(VectorFieldIndex):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, arg2):
        _fieldindex.OutOfPlaneVectorFieldIndex_swiginit(self, _fieldindex.new_OutOfPlaneVectorFieldIndex(arg2))

    def __repr__(self):
        return _fieldindex.OutOfPlaneVectorFieldIndex___repr__(self)
    __swig_destroy__ = _fieldindex.delete_OutOfPlaneVectorFieldIndex

# Register OutOfPlaneVectorFieldIndex in _fieldindex:
_fieldindex.OutOfPlaneVectorFieldIndex_swigregister(OutOfPlaneVectorFieldIndex)
class SymTensorIndex(FieldIndex):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, arg2, arg3):
        _fieldindex.SymTensorIndex_swiginit(self, _fieldindex.new_SymTensorIndex(arg2, arg3))

    def row(self):
        return _fieldindex.SymTensorIndex_row(self)

    def col(self):
        return _fieldindex.SymTensorIndex_col(self)

    def diagonal(self):
        return _fieldindex.SymTensorIndex_diagonal(self)

    def __repr__(self):
        return _fieldindex.SymTensorIndex___repr__(self)
    __swig_destroy__ = _fieldindex.delete_SymTensorIndex

# Register SymTensorIndex in _fieldindex:
_fieldindex.SymTensorIndex_swigregister(SymTensorIndex)
class OutOfPlaneSymTensorIndex(SymTensorIndex):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, arg2, arg3):
        _fieldindex.OutOfPlaneSymTensorIndex_swiginit(self, _fieldindex.new_OutOfPlaneSymTensorIndex(arg2, arg3))
    __swig_destroy__ = _fieldindex.delete_OutOfPlaneSymTensorIndex

# Register OutOfPlaneSymTensorIndex in _fieldindex:
_fieldindex.OutOfPlaneSymTensorIndex_swigregister(OutOfPlaneSymTensorIndex)
class ComponentIteratorP(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")

    def increment(self):
        return _fieldindex.ComponentIteratorP_increment(self)

    def current(self):
        return _fieldindex.ComponentIteratorP_current(self)

    def __ne__(self, arg2):
        return _fieldindex.ComponentIteratorP___ne__(self, arg2)

    def __repr__(self):
        return _fieldindex.ComponentIteratorP___repr__(self)
    __swig_destroy__ = _fieldindex.delete_ComponentIteratorP

# Register ComponentIteratorP in _fieldindex:
_fieldindex.ComponentIteratorP_swigregister(ComponentIteratorP)
class ComponentsP(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def begin(self):
        return _fieldindex.ComponentsP_begin(self)

    def end(self):
        return _fieldindex.ComponentsP_end(self)
    __swig_destroy__ = _fieldindex.delete_ComponentsP

# Register ComponentsP in _fieldindex:
_fieldindex.ComponentsP_swigregister(ComponentsP)
class SymTensorIJIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")

    def increment(self):
        return _fieldindex.SymTensorIJIterator_increment(self)

    def fieldindex(self):
        return _fieldindex.SymTensorIJIterator_fieldindex(self)

    def __ne__(self, arg2):
        return _fieldindex.SymTensorIJIterator___ne__(self, arg2)

    def __repr__(self):
        return _fieldindex.SymTensorIJIterator___repr__(self)
    __swig_destroy__ = _fieldindex.delete_SymTensorIJIterator

# Register SymTensorIJIterator in _fieldindex:
_fieldindex.SymTensorIJIterator_swigregister(SymTensorIJIterator)
class SymTensorIJComponents(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def begin(self):
        return _fieldindex.SymTensorIJComponents_begin(self)

    def end(self):
        return _fieldindex.SymTensorIJComponents_end(self)
    __swig_destroy__ = _fieldindex.delete_SymTensorIJComponents

# Register SymTensorIJComponents in _fieldindex:
_fieldindex.SymTensorIJComponents_swigregister(SymTensorIJComponents)

def getSymTensorComponents(arg1):
    return _fieldindex.getSymTensorComponents(arg1)
# -*- python -*-

# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we ask that before distributing modified
# versions of this software, you first contact the authors at
# oof_manager@nist.gov. 

from ooflib.common import debug

def _SymTensorIJComponents__iter__(self):
    beginp = self.begin()
    endp = self.end()
    while beginp != endp:
        yield beginp.fieldindex()
        beginp.increment()

SymTensorIJComponents.__iter__ = _SymTensorIJComponents__iter__

def _ComponentsP__iter__(self):
    beginp = self.begin()
    endp = self.end()
    while beginp != endp:
        yield beginp.current()
        beginp.increment()

ComponentsP.__iter__ = _ComponentsP__iter__


cvar = _fieldindex.cvar
symTensorIJComponents = cvar.symTensorIJComponents

