def _configure(self): """ Setup members using inventory. """ BoundaryCondition._configure(self) TimeDependentPoints._configure(self) return
def finalize(self): """ Cleanup. """ BoundaryCondition.finalize(self) Constraint.finalize(self) return
def preinitialize(self, mesh): """ Do pre-initialization setup. """ BoundaryCondition.preinitialize(self, mesh) Constraint.preinitialize(self, mesh) return
def preinitialize(self, mesh): """ Do pre-initialization setup. """ BoundaryCondition.preinitialize(self, mesh) Integrator.preinitialize(self, mesh) return
def finalize(self): """ Cleanup. """ BoundaryCondition.finalize(self) Integrator.finalize(self) self._modelMemoryUse() return
def _configure(self): """ Setup members using inventory. """ BoundaryCondition._configure(self) self.bcQuadrature = self.inventory.quadrature ModuleAbsorbingDampers.db(self, self.inventory.db) return
def __init__(self, name="pointforce"): """ Constructor. """ BoundaryCondition.__init__(self, name) Integrator.__init__(self) self._loggingPrefix = "PFBC " return
def __init__(self, name="dirichletbc"): """ Constructor. """ BoundaryCondition.__init__(self, name) Constraint.__init__(self) self._loggingPrefix = "DiBC " return
def __init__(self, name="absorbingdampers"): """ Constructor. """ BoundaryCondition.__init__(self, name) Integrator.__init__(self) self._loggingPrefix = "AbBC " return
def _configure(self): """ Setup members using inventory. """ BoundaryCondition._configure(self) TimeDependent._configure(self) self.bcQuadrature = self.inventory.bcQuadrature self.output = self.inventory.output return
def preinitialize(self, mesh): """ Do pre-initialization setup. """ BoundaryCondition.preinitialize(self, mesh) Integrator.preinitialize(self, mesh) self.bcQuadrature.preinitialize(mesh.coordsys().spaceDim()) self.quadrature(self.bcQuadrature) self.createSubMesh(mesh) return
def verifyConfiguration(self): """ Verify compatibility of configuration. """ logEvent = "%sverify" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) BoundaryCondition.verifyConfiguration(self, self.mesh()) self._eventLogger.eventEnd(logEvent) return
def _configure(self): """ Setup members using inventory. """ try: BoundaryCondition._configure(self) TimeDependentPoints._configure(self) except ValueError, err: aliases = ", ".join(self.aliases) raise ValueError("Error while configuring Dirichlet boundary condition " "(%s):\n%s" % (aliases, err.message))
def _configure(self): """ Setup members using inventory. """ try: BoundaryCondition._configure(self) TimeDependentPoints._configure(self) except ValueError, err: aliases = ", ".join(self.aliases) raise ValueError( "Error while configuring Dirichlet boundary condition " "(%s):\n%s" % (aliases, err.message))
def verifyConfiguration(self): """ Verify compatibility of configuration. """ logEvent = "%sverify" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) BoundaryCondition.verifyConfiguration(self, self.mesh()) spaceDim = self.mesh().coordsys().spaceDim() for d in self.bcDOF: if d < 0 or d >= spaceDim: raise ValueError("Attempting to constrain DOF (%d) that doesn't exist. Space dimension is %d." % \ (d, spaceDim)) self._eventLogger.eventEnd(logEvent) return
def __init__(self, name="neumann"): """ Constructor. """ BoundaryCondition.__init__(self, name) Integrator.__init__(self) TimeDependent.__init__(self) self._loggingPrefix = "NeBC " self.availableFields = \ {'vertex': \ {'info': [], 'data': []}, 'cell': \ {'info': [], 'data': []}} return
def initialize(self, totalTime, numTimeSteps, normalizer): """ Initialize PointForce boundary condition. """ logEvent = "%sinit" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) from pylith.mpi.Communicator import mpi_comm_world comm = mpi_comm_world() if 0 == comm.rank: self._info.log("Initializing point forces '%s'." % self.label()) Integrator.initialize(self, totalTime, numTimeSteps, normalizer) BoundaryCondition.initialize(self, totalTime, numTimeSteps, normalizer) self._eventLogger.eventEnd(logEvent) return
def verifyConfiguration(self): """ Verify compatibility of configuration. """ logEvent = "%sverify" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) BoundaryCondition.verifyConfiguration(self, self.mesh()) Integrator.verifyConfiguration(self) if self.bcQuadrature.cellDim() != self.mesh().dimension() - 1: raise ValueError, "Quadrature scheme and mesh are incompatible.\n" "Dimension for quadrature: %d\n" "Dimension of mesh boundary '%s': %d" % ( self.bcQuadrature.cellDim, self.label(), self.mesh().dimension() - 1, ) ModuleAbsorbingDampers.verifyConfiguration(self, self.mesh()) self._eventLogger.eventEnd(logEvent) return
def preinitialize(self, mesh): """ Do pre-initialization setup. """ BoundaryCondition.preinitialize(self, mesh) Integrator.preinitialize(self, mesh) self.bcQuadrature.preinitialize(mesh.coordsys().spaceDim()) self.quadrature(self.bcQuadrature) self.createSubMesh(mesh) self.output.preinitialize(self) fields = [] if not isinstance(self.inventory.dbInitial, NullComponent): fields += ["initial_value"] if not isinstance(self.inventory.dbRate, NullComponent): fields += ["rate_of_change", "rate_start_time"] if not isinstance(self.inventory.dbChange, NullComponent): fields += ["change_in_value", "change_start_time"] self.availableFields['cell']['info'] += fields return
def verifyConfiguration(self): """ Verify compatibility of configuration. """ logEvent = "%sverify" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) BoundaryCondition.verifyConfiguration(self, self.mesh()) Integrator.verifyConfiguration(self) if self.bcQuadrature.cellDim() != self.mesh().dimension() - 1: raise ValueError, \ "Quadrature scheme and mesh are incompatible.\n" \ "Dimension for quadrature: %d\n" \ "Dimension of mesh boundary '%s': %d" % \ (self.bcQuadrature.cellDim, self.label(), self.mesh().dimension()-1) ModuleAbsorbingDampers.verifyConfiguration(self, self.mesh()) self._eventLogger.eventEnd(logEvent) return
def initialize(self, totalTime, numTimeSteps, normalizer): """ Initialize Neumann boundary condition. """ logEvent = "%sinit" % self._loggingPrefix self._eventLogger.eventBegin(logEvent) from pylith.mpi.Communicator import mpi_comm_world comm = mpi_comm_world() if 0 == comm.rank: self._info.log("Initializing Neumann boundary '%s'." % self.label()) Integrator.initialize(self, totalTime, numTimeSteps, normalizer) BoundaryCondition.initialize(self, totalTime, numTimeSteps, normalizer) self.output.initialize(normalizer, self.bcQuadrature) self.output.writeInfo() self._eventLogger.eventEnd(logEvent) return