Exemple #1
0
    def prepare(self):
        # create project directory name
        self.createProjectName()

        # create snappy and domain object
        self._snappy = Snappy.Snappy(self._snappyHexMeshDir, self._logger)
        self._domain = Domain.Domain(self._snappyHexMeshDir, self._logger)
        self._simple = Simple.Simple(self._simpleFoamDir,
                                     self._snappyHexMeshDir, self._logger)

        # read/load solid
        if self._snappy.solidWritten() and not self._solidfile:
            self._logger.info("Loading Solid from snappyHexMesh")
            [self._solid, self._refsolid] = self._snappy.loadSolid()
        else:
            # check if solid file exists
            self.checkSolidFile(self._solidfile)
            self._solid = Solid.createSolidFromSTL(self._solidfile)

            self.checkSolidFile(self._refsolidfile)
            self._refsolid = Solid.createSolidFromSTL(self._refsolidfile)

            if self._edgesolidfile:
                self.checkSolidFile(self._edgesolidfile)
                self._edgesolid = Solid.createSolidFromSTL(self._edgesolidfile)

        # assign solid to snappy/domain-object
        self._snappy.setsolid(self._solid)
        self._snappy.setRefsolid(self._refsolid)
        self._snappy.setEdgesolid(self._edgesolid)
        self._domain.setsolid(self._solid)

        self._simple.setVelocityKnots(self._speedknots)
#####################################################################################
#
#  Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you cannot locate the  Apache License, Version 2.0, please send an email to
# [email protected]. By using this source code in any fashion, you are agreeing to be bound
# by the terms of the Apache License, Version 2.0.
#
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################

import clr
clr.AddReferenceToFile("vbextend.dll")
import Simple
a = Simple(10)


def X(i):
    return i + 100


a.Transform(X)
Exemple #3
0
# you cannot locate the  Apache License, Version 2.0, please send an email to
# [email protected]. By using this source code in any fashion, you are agreeing to be bound
# by the terms of the Apache License, Version 2.0.
#
# You must not remove this notice, or any other, from this software.
#
#
#####################################################################################

# Task 1

import clr
clr.AddReferenceToFile("csextend.dll")
import Simple
dir(Simple)
s = Simple(10)
print s

# Task 2

import clr
clr.AddReferenceToFile("csextend.dll")
import Simple
dir(Simple)
s = Simple(10)
for i in s:
    print i

# Task 3

import clr
Exemple #4
0
print("hi my name is aghasomwan osahumen")
print("Enter 1 for Simple Interest")
print("Enter 2 for Compound Interest ")
print("Enter 3 for Effective rate ")

num = int(input("enter the number of the one you wish to calculate "))

if num == 1:
    import Simple
    z = 0
    print(Simple.simple(z))
elif num == 2:
    import Compound
    A = 0
    print(Compound.comp(A))
#elif num == 3: