63UserDefDirichletBC :: give(
Dof *dof, ValueModeType mode,
double time)
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;