当前位置: 首页>>代码示例>>Python>>正文


Python Grid.createModLinearGrid方法代码示例

本文整理汇总了Python中pysgpp.Grid.createModLinearGrid方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.createModLinearGrid方法的具体用法?Python Grid.createModLinearGrid怎么用?Python Grid.createModLinearGrid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pysgpp.Grid的用法示例。


在下文中一共展示了Grid.createModLinearGrid方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testSerializationModLinearBoundingBox

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
    def testSerializationModLinearBoundingBox(self):
        """Uses Linear grid for tests"""
        from pysgpp import Grid
        
        factory = Grid.createModLinearGrid(2)
        self.failIfEqual(factory, None)

        gen = factory.createGridGenerator()
        gen.regular(3)

        boundingBox = factory.getBoundingBox()
        tempBound = boundingBox.getBoundary(0)
        tempBound.leftBoundary = 0.0
        tempBound.rightBoundary = 100.0
        tempBound.bDirichletLeft = False;
        tempBound.bDirichletRight = False;
        boundingBox.setBoundary(0, tempBound)

        str = factory.serialize()
        self.assert_(len(str) > 0)
        
        newfac = Grid.unserialize(str)
        self.failIfEqual(newfac, None)
        
        self.assertEqual(factory.getStorage().size(), newfac.getStorage().size())
        
        boundingBox = newfac.getBoundingBox()
        tempBound = boundingBox.getBoundary(0)
        self.assertEqual(0.0, tempBound.leftBoundary)
        self.assertEqual(100.0, tempBound.rightBoundary)
        self.assertEqual(False, tempBound.bDirichletLeft)
        self.assertEqual(False, tempBound.bDirichletRight)
开发者ID:samhelmholtz,项目名称:skinny-dip,代码行数:34,代码来源:test_GridFactory.py

示例2: testHierarchisationDModLinearWithBoundary

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
    def testHierarchisationDModLinearWithBoundary(self):
        from pysgpp import Grid

        dim = 3
        level = 5
        function = buildParableBoundary(dim)
        grid = Grid.createModLinearGrid(dim)
        testHierarchisationDehierarchisation(self, grid, level, function)
开发者ID:samhelmholtz,项目名称:skinny-dip,代码行数:10,代码来源:test_hierarchisation.py

示例3: testHierarchisation1DModLinear

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
 def testHierarchisation1DModLinear(self):
     from pysgpp import Grid
     
     dim = 1
     level = 5
     function = buildParable(dim)
     grid = Grid.createModLinearGrid(dim)
     testHierarchisationDehierarchisation(self, grid, level, function)
开发者ID:samhelmholtz,项目名称:skinny-dip,代码行数:10,代码来源:test_hierarchisation.py

示例4: testHatRegular1D

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
    def testHatRegular1D(self):
        from pysgpp import Grid
        
        factory = Grid.createModLinearGrid(1)

        m = generateLaplaceMatrix(factory, 5)
        m_ref = readReferenceMatrix(self, factory.getStorage(), 'data/C_laplace_phi_li_ausgeklappt_dim_1_nopsgrid_31_float.dat.gz')

        # compare
        compareStiffnessMatrices(self, m, m_ref)
开发者ID:samhelmholtz,项目名称:skinny-dip,代码行数:12,代码来源:test_laplace.py

示例5: testHatRegulardD_two

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
    def testHatRegulardD_two(self):
        from pysgpp import Grid

        factory = Grid.createModLinearGrid(3)
        training = buildTrainingVector(readDataVector('data/data_dim_3_nops_512_float.arff.gz'))
        level = 4
        gen = factory.createGridGenerator()
        gen.regular(level)

        m = generateBBTMatrix(factory, training)
        m_ref = readReferenceMatrix(self, factory.getStorage(), 'data/BBT_phi_li_ausgeklappt_dim_3_nopsgrid_111_float.dat.gz')

        # compare
        compareBBTMatrices(self, m, m_ref)
开发者ID:ABAtanasov,项目名称:Sparse-Grids,代码行数:16,代码来源:test_BBT.py

示例6: testSerializationModLinear

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
    def testSerializationModLinear(self):
        """Uses Linear grid for tests"""
        from pysgpp import Grid
        
        factory = Grid.createModLinearGrid(2)
        self.failIfEqual(factory, None)

        gen = factory.createGridGenerator()
        gen.regular(3)

        str = factory.serialize()
        self.assert_(len(str) > 0)
        
        newfac = Grid.unserialize(str)
        self.failIfEqual(newfac, None)
        
        self.assertEqual(factory.getStorage().size(), newfac.getStorage().size())
开发者ID:samhelmholtz,项目名称:skinny-dip,代码行数:19,代码来源:test_GridFactory.py

示例7: testSerializationModLinearWithLeaf

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
    def testSerializationModLinearWithLeaf(self):
        """Uses Linear grid for tests"""
        from pysgpp import Grid
        
        srcLeaf = []
        factory = Grid.createModLinearGrid(2)
        self.failIfEqual(factory, None)

        gen = factory.createGridGenerator()
        gen.regular(3)

        for i in xrange(factory.getStorage().size()):
            srcLeaf.append(factory.getStorage().get(i).isLeaf())

        str = factory.serialize()
        self.assert_(len(str) > 0)
        
        newfac = Grid.unserialize(str)
        self.failIfEqual(newfac, None)
        
        self.assertEqual(factory.getStorage().size(), newfac.getStorage().size())
        
        for i in xrange(factory.getStorage().size()):
            self.failUnlessEqual(newfac.getStorage().get(i).isLeaf(), srcLeaf[i])
开发者ID:samhelmholtz,项目名称:skinny-dip,代码行数:26,代码来源:test_GridFactory.py

示例8: setUp

# 需要导入模块: from pysgpp import Grid [as 别名]
# 或者: from pysgpp.Grid import createModLinearGrid [as 别名]
 def setUp(self):
     self.grid = Grid.createModLinearGrid(2)  # a simple 2D grid
     self.grid.createGridGenerator().regular(3)  # max level 3 => 17 points
     self.grid_storage = self.grid.getStorage()
开发者ID:ABAtanasov,项目名称:Sparse-Grids,代码行数:6,代码来源:test_ANOVARefinement.py


注:本文中的pysgpp.Grid.createModLinearGrid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。