Example #1
0
    def set_boundary_conditions(self, mesh):
        ## here, mesh is a Mesh (Who) object
        displacement = field.getField('Displacement')
        if config.dimension() == 2:
            ## left boundary
            self.leftBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'x',
                                          equation.getEquation('Force_Balance'),
                                          'x',
                                          profile.ConstantProfile(0),
                                          'left'
                                          )
            self.leftBoundaryCondition.add_to_mesh('left', mesh.path())

            ## right boundary
            self.rightBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'x',
                                          equation.getEquation('Force_Balance'),
                                          'x',
                                          profile.ConstantProfile(0),
                                          'right'
                                          )
            self.rightBoundaryCondition.add_to_mesh('right', mesh.path())

            ## top boundary
            self.topBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'y',
                                          equation.getEquation('Force_Balance'),
                                          'y',
                                          profile.ConstantProfile(0),
                                          'top'
                                          )
            self.topBoundaryCondition.add_to_mesh('top', mesh.path())

            ## bottom boundary
            self.bottomBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'y',
                                          equation.getEquation('Force_Balance'),
                                          'y',
                                          profile.ConstantProfile(0),
                                          'bottom'
                                          )
            self.bottomBoundaryCondition.add_to_mesh('bottom', mesh.path())
Example #2
0
    def set_boundary_conditions(self, mesh):
        ## here, mesh is a Mesh (Who) object
        displacement = field.getField('Displacement')
        if config.dimension() == 2:
            ## left boundary
            self.leftBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'x',
                                          equation.getEquation('Force_Balance'),
                                          'x',
                                          profile.ConstantProfile(0),
                                          'left'
                                          )
            self.leftBoundaryCondition.add_to_mesh('left', mesh.path())

            ## right boundary
            self.rightBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'x',
                                          equation.getEquation('Force_Balance'),
                                          'x',
                                          profile.ConstantProfile(0),
                                          'right'
                                          )
            self.rightBoundaryCondition.add_to_mesh('right', mesh.path())

            ## top boundary
            self.topBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'y',
                                          equation.getEquation('Force_Balance'),
                                          'y',
                                          profile.ConstantProfile(0),
                                          'top'
                                          )
            self.topBoundaryCondition.add_to_mesh('top', mesh.path())

            ## bottom boundary
            self.bottomBoundaryCondition = \
                 bdycondition.DirichletBC(displacement,
                                          'y',
                                          equation.getEquation('Force_Balance'),
                                          'y',
                                          profile.ConstantProfile(0),
                                          'bottom'
                                          )
            self.bottomBoundaryCondition.add_to_mesh('bottom', mesh.path())
Example #3
0
 def activate_equations(self, meshctxt):
     meshctxt.get_default_subproblem().getObject().activate_equation(
         equation.getEquation('Force_Balance'))
Example #4
0
 def activate_equations(self, meshctxt):
     meshctxt.get_default_subproblem().getObject().activate_equation(
         equation.getEquation('Force_Balance'))