66 if ( mode == VM_Total ) {
68 }
else if ( mode == VM_Velocity ) {
70 }
else if ( mode == VM_Acceleration ) {
73 OOFEM_ERROR(
"Should not be called for value mode type then total, velocity, or acceleration.");
88 PyObject *pArgArray = PyList_New(dim);
90 PyObject *pArgs = PyTuple_New(numArgs);
92 for (
int i = 0; i < dim; i++ ) {
93 PyList_SET_ITEM( pArgArray, i, PyFloat_FromDouble( dMan->
giveCoordinate(i + 1) ) );
98 PyTuple_SetItem(pArgs, 0, pArgArray);
101 PyTuple_SetItem(pArgs, 1, PyLong_FromLong( dof->
giveDofID() ));
104 PyTuple_SetItem(pArgs, 2, PyFloat_FromDouble( time ));
109 if ( PyCallable_Check(
mpFunc) ) {
110 pRetVal = PyObject_CallObject(
mpFunc, pArgs);
117 if ( pRetVal != NULL ) {
118 retVal = PyFloat_AsDouble(pRetVal);
120 OOFEM_ERROR(
"Failed to fetch Python return value.");
127 return retVal * factor;
150 if ( mpModule != NULL ) {
152 mpFunc = PyObject_GetAttrString(mpModule,
"giveUserDefBC");
REGISTER_BoundaryCondition(BoundaryCondition)
virtual double evaluateAccelerationAtTime(double t)=0
Returns the second time derivative of the function at given time.
#define _IFT_UserDefDirichletBC_filename
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Function * giveTimeFunction()
virtual FloatArray * giveCoordinates()
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Base class for dof managers.
virtual void scale(double s)
Scales the receiver according to given value.
FloatArray values
Prescribed values for each resp. dof.
virtual ~UserDefDirichletBC()
Destructor.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class implementing Dirichlet boundary condition on DOF (primary boundary condition).
virtual double give(Dof *dof, ValueModeType mode, double time)
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual double evaluateVelocityAtTime(double t)=0
Returns the first time derivative of the function at given time.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
IRResultType
Type defining the return values of InputRecord reading operations.
void times(double s)
Multiplies receiver with scalar.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
DofManager * giveDofManager() const
int giveSize() const
Returns the size of receiver.
virtual double giveCoordinate(int i)
the oofem namespace is to define a context or scope in which all oofem names are defined.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
#define OOFEM_WARNING(...)
UserDefDirichletBC(int i, Domain *d)
Constructor.