Beispiel #1
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(
            name="Jemmy's Example 1",
            numSegments=3,
            bifurcationPoints=1,
            domainE=Domains(space=[0, 1], time=[0, 1]),
            domainLw=Domains(space=[1, 2], time=[0, 1]),
            domainUp=Domains(space=[1, 3], time=[0, 1]),
            bcDomainE=BoundaryConditions(SealedEnd(), SealedEnd()),
            bcDomainLw=BoundaryConditions(SealedEnd(), SealedEnd()),
            bcDomainUp=BoundaryConditions(SealedEnd(), SealedEnd()),
            solutionE=[],
            solutionLw=[],
            solutionUp=[],
            description="This is the solution for the \
                                                  following problem:\
                                                  Problem being solved is: [0,3]X[0,1]\
                                                  d2u/dx2 = du\dt + u \
                                                  BC:  du/dx(0,t) = du/dx(2,t) = du/dx(3,t) = 0 \
                                                  Initial Conditions:\
                                                  u(x,0) = cos(pi*x)\
                                                  Solution: u = (e^(-(1 + pi^2)*t)*cos(pi*x)"
        )

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(JemmyEx1, self).__init__(whole_options, **kw)
Beispiel #2
0
    def __init__(self,
                 name,
                 localConditions,
                 domain,
                 steps,
                 iModel,
                 options=Options(),
                 **kw):
        # Define the default options
        default_options = Options(
            **{
                constants().Domain: domain,
                constants().Steps: steps,
                constants().Name: name,
                constants().LocalConditions: localConditions,
                constants().IModel: iModel
            })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(ISegment, self).__init__(whole_options, **kw)

        self.iModel.domain = self.domain
        self.iModel.BCs = self.localConditions
        self.iModel.steps = self.steps
Beispiel #3
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(
            name="Jemmy's Example 2",
            numSegments=3,
            bifurcationPoints=1,
            segmentsDomain=[
                Domains(space=[0, pi / 2], time=[0, 1]),
                Domains(space=[pi / 2, pi], time=[0, 1]),
                Domains(space=[pi / 2, 3 * (pi / 2)], time=[0, 1])
            ],
            boundaryConditions=[
                BoundaryConditions(SealedEnd(), SealedEnd()),
                BoundaryConditions(SealedEnd(), SealedEnd()),
                BoundaryConditions(SealedEnd(), SealedEnd())
            ],
            description="This is the solution for the \
                                                  following problem:\
                                                  Problem being solved is: [0,3*pi/2]X[0,1]\
                                                  d2u/dx2 = du\dt - 2*u \
                                                  BC:  du/dx(0,t) = -e^t, du/dx(pi,t) = e^t , du/dx(3*pi/2,t) = 0 \
                                                  Initial Conditions:\
                                                  u(x,0) = -sin(x)\
                                                  Solution: u = (e^-t)*sin(x)")

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(JemmyEx2, self).__init__(whole_options, **kw)
Beispiel #4
0
    def __init__(self, options=Options(), **kw):

        #Other Example would be:
        # Ek = -77,
        # ENa = 50,
        # ELeaky = -54.4,

        # Define the default options
        default_options = Options(name="Cable Model",
                                  results=[],
                                  gk=36,
                                  gNa=120,
                                  gLeaky=0.3,
                                  Ek=-12,
                                  ENa=115,
                                  ELeaky=10.6,
                                  coeff_t=None,
                                  coeff_dx2=None,
                                  coeff_v=None,
                                  coeff_font=None)

        # Merge the default options and the user generated options
        whole_options = default_options << options

        #print("CableModel Kw Options:",kw)
        #print("\nCableModel Whole Options:",whole_options.__dict__)

        super(CableModel, self).__init__(whole_options, **kw)
Beispiel #5
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(
            **{
                constants().Name: Names().IModel,
                constants().Domain: None,
                constants().Steps: None,
                constants().CurrentTime: None,
                constants().InitialCondition: None,
                constants().Results: [],
                constants().Coeffs: None,
                constants().Font: None,
                constants().BCs: None,
                constants().IApproximation: None,
                constants().TimeApproximation: None,
                constants().Equation: {}
            })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        # print("IModel Kw Options:",kw)
        # print("\nIModel Whole Options:",whole_options.__dict__)

        super(IModel, self).__init__(whole_options, **kw)
Beispiel #6
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(
            **{
                constants().Name: Names().FEMElement,
                constants().Domain: None,
                constants().NumLocalNodes: None,
                constants().NumIntegration: None,
                constants().Matrix: None,
                constants().Font: None,
                constants().CoupledApprox: None,
                constants().ExtraData: {
                    constants().Previous: []
                },
                constants().Bilinear: None,
                constants().Linear: None
            })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(IElement, self).__init__(whole_options, **kw)

        self.__prepareData()
Beispiel #7
0
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(**{constants().Name: Names().ClassicGalerkin})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(GalerkinApproximation, self).__init__(whole_options, **kw)
Beispiel #8
0
    def __init__(self, userCoeff, options=Options(), **kw):

        # Define the default options
        default_options = Options(name="Discrete", positionCalculations={})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(HH, self).__init__(whole_options, **kw)
Beispiel #9
0
    def __init__(self, space, time=None, options=Options(), **kw):

        # Define the default options
        default_options = Options(name="Steps", space=space, time=time)

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(Steps, self).__init__(whole_options, **kw)
Beispiel #10
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(name="Boundary Condition")

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(ICondition, self).__init__(whole_options, **kw)
Beispiel #11
0
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(**{constants().Name: Names().Equation,
                                   constants().Coeffs: {}})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(IEquation, self).__init__(whole_options, **kw)
Beispiel #12
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        self.default_options = Options(name="Neuron")

        # Merge the default options and the user generated options
        whole_options = self.default_options << options

        # Initialize the options and the extra arguments
        self.class_option.init_options(self, whole_options, kw)
Beispiel #13
0
 def __init__(self,options=Options(), **kw):
     '''A class initializer.'''
     
      # Define the default options
     default_options = Options(**{constants().Name:Names().BackwardEuler})
     
     
     # Merge the default options and the user generated options
     whole_options = default_options << options
     
     super(BackwardEuler,self).__init__(whole_options,**kw)
Beispiel #14
0
    def __init__(self, bcValue, options=Options(), **kw):
        # Define the default options
        default_options = Options(**{
            constants().Name: Names().VoltageClamp,
            constants().BcValue: bcValue
        })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(VoltageClamp, self).__init__(whole_options, **kw)
Beispiel #15
0
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(**{
            constants().Name: Names().Trapezoidal,
            constants().NumPoints: 2
        })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(Trapezoidal, self).__init__(whole_options, **kw)
Beispiel #16
0
    def __init__(self, options=Options(), **kw):
        '''Class initializer. Use it's Base Class initializer
        and adds the weight function to be used. '''

        # Define the default options
        default_options = Options(**{constants().Name: Components().Diffusion})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(Diffusion, self).__init__(whole_options, **kw)
Beispiel #17
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(name="IProtocol",
                                  dataToBeAnalysed=IDataAnalysed(),
                                  data=None)

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(TestProtocols, self).__init__(whole_options, **kw)
Beispiel #18
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(**{constants().Name: Names().SimuPlots,
                                     constants().Marker: itertools.cycle((',', '+', '.', 'o', '*', 'v', '>', '<')),
                                     constants().Linestyles: itertools.cycle(('--', '-', '-.', ':'))})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(Simulation, self).__init__(whole_options, **kw)
Beispiel #19
0
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(**{constants().Name: Names().IAnalysis,
                                   constants().Description: Descriptions().IAnalysis,
                                   constants().Solution: None,
                                   constants().Domain: None,
                                   constants().Steps: None})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(IAnalysis, self).__init__(whole_options, **kw)
Beispiel #20
0
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(
            **{
                constants().Name: Names().GenericIntegration,
                constants().Domain: [-1, 1]
            })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(IIntegration, self).__init__(whole_options, **kw)
Beispiel #21
0
    def __init__(self, userCoeff, options=Options(), **kw):

        # Define the default options
        default_options = Options(name="Coefficient",
                                  customFunctions={},
                                  coeffType=self.__identifyType(userCoeff),
                                  value=userCoeff)

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(ICoefficient, self).__init__(whole_options, **kw)
Beispiel #22
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(**{
            constants().Name: Names().SealedEnd,
            constants().BcValue: 0.0
        })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(SealedEnd, self).__init__(whole_options, **kw)
Beispiel #23
0
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(
            **{
                constants().Name: Names().WeightFunction,
                constants().NumLocalNodes: None
            })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(IWeightFunction, self).__init__(whole_options, **kw)
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(name="Default", neuron=NetX_Neuron())

        # Merge the default options and the user generated options
        whole_options = default_options << options

        # Initialize the options and the extra arguments
        self.class_option.init_options(self, whole_options, kw)

        self.__prepareClasses()
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(**{constants().Name: Names().StationaryBaseClass,
                                   constants().Description: Descriptions().StationaryBaseClass,
                                   constants().SElements: None,
                                   constants().BCs: None,
                                   constants().Solution: []})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(StationaryBase, self).__init__(whole_options, **kw)
Beispiel #26
0
    def __init__(self, options=Options(), **kw):
        '''A class initializer.'''

        # Define the default options
        default_options = Options(**{constants().Name: Names().CoupledHHAproximations,
                                   constants().M: [],
                                   constants().N: [],
                                   constants().H: []})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(CoupledHHApprox, self).__init__(whole_options, **kw)
Beispiel #27
0
    def __init__(self, options=Options(), **kw):
        # Define the default options
        default_options = Options(
            **{
                constants().Name: Names().Neumann,
                constants().BcValue: 1.0,
                constants().BcType: constants().Neumann
            })

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(Neumann, self).__init__(whole_options, **kw)
Beispiel #28
0
    def __init__(self, component, options=Options(), **kw):
        '''Class initializer. Use it's Base Class initializer
        and adds the weight function to be used. '''

        # Define the default options
        default_options = Options(name="NonLinear" + component.name,
                                  inComponent=component,
                                  discreteElements={})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(Discrete, self).__init__(whole_options, **kw)
Beispiel #29
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(**{constants().Name: Names().IProblem,
                                   constants().Description: Descriptions().IProblem,
                                   constants().SpatialSteps: None,
                                   constants().Mesh: None,
                                   constants().BCs: None})

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(IProblem, self).__init__(whole_options, **kw)
Beispiel #30
0
    def __init__(self, options=Options(), **kw):

        # Define the default options
        default_options = Options(name="ISolution",
                                  description="A Solution Interface",
                                  sElements=None,
                                  BCs=None,
                                  solution=[])

        # Merge the default options and the user generated options
        whole_options = default_options << options

        super(ISolution, self).__init__(whole_options, **kw)