@@ -582,42 +582,38 @@ public:
582582
583583 } // addPoroelasticContextBodyForceSourceDensity
584584
585- /* * f0 function for displacement equation: f0u = \dot{u}.
585+ /* * f0 function for displacement equation: f0u = \dot{u}.
586586 *
587587 * Solution fields: [disp(dim), vel(dim)]
588588 */
589589 static inline
590590 void f0u_explicit (const PylithInt dim,
591- const PylithInt numS,
592- const PylithInt numA,
593- const PylithInt sOff [],
594- const PylithInt sOff_x [],
595- const PylithScalar s[],
596- const PylithScalar s_t [],
597- const PylithScalar s_x[],
598- const PylithInt aOff[],
599- const PylithInt aOff_x[],
600- const PylithScalar a[],
601- const PylithScalar a_t [],
602- const PylithScalar a_x[],
603- const PylithReal t,
604- const PylithScalar x[],
605- const PylithInt numConstants,
606- const PylithScalar constants[],
607- PylithScalar f0[]) {
608- assert (sOff );
609- assert (s);
610- assert (s_t );
611- assert (f0);
612- printf (" f0u_explicit \n " );
613- const PylithInt _numS = 3 ;
614- assert (_numS == numS);
591+ const PylithInt numS,
592+ const PylithInt numA,
593+ const PylithInt sOff [],
594+ const PylithInt sOff_x [],
595+ const PylithScalar s[],
596+ const PylithScalar s_t [],
597+ const PylithScalar s_x[],
598+ const PylithInt aOff[],
599+ const PylithInt aOff_x[],
600+ const PylithScalar a[],
601+ const PylithScalar a_t [],
602+ const PylithScalar a_x[],
603+ const PylithReal t,
604+ const PylithScalar x[],
605+ const PylithInt numConstants,
606+ const PylithScalar constants[],
607+ PylithScalar f0[]) {
608+ pylith::fekernels::Poroelasticity::PoroelasticContext poroelasticContext;
609+ pylith::fekernels::Poroelasticity::setPoroelasticContextDynamic (
610+ &poroelasticContext, dim, numS, sOff , sOff_x , s, s_t , s_x, aOff, aOff_x, a, a_t , a_x, t, x);
615611
616- const PylithInt i_disp = 0 ;
617- const PylithScalar* disp_t = & s_t [ sOff [i_disp]] ;
612+ const PylithScalar * displacement_t = poroelasticContext. displacement_t ;
613+ const PylithScalar *velocity = poroelasticContext. velocity ;
618614
619615 for (PylithInt i = 0 ; i < dim; ++i) {
620- f0[i] += disp_t [i];
616+ f0[i] += displacement_t [i] - velocity [i];
621617 } // for
622618 } // f0u_explicit
623619
@@ -657,35 +653,34 @@ public:
657653
658654#endif
659655
660- // Calculate bulk density
656+ // Calculate bulk density
661657 static inline
662658 void bulkDensity_asScalar (const PylithInt dim,
663- const PylithInt numS,
664- const PylithInt numA,
665- const PylithInt sOff [],
666- const PylithInt sOff_x [],
667- const PylithScalar s[],
668- const PylithScalar s_t [],
669- const PylithScalar s_x[],
670- const PylithInt aOff[],
671- const PylithInt aOff_x[],
672- const PylithScalar a[],
673- const PylithScalar a_t [],
674- const PylithScalar a_x[],
675- const PylithReal t,
676- const PylithScalar x[],
677- const PylithInt numConstants,
678- const PylithScalar constants[],
679- PylithReal* bulkDensity) {
680-
659+ const PylithInt numS,
660+ const PylithInt numA,
661+ const PylithInt sOff [],
662+ const PylithInt sOff_x [],
663+ const PylithScalar s[],
664+ const PylithScalar s_t [],
665+ const PylithScalar s_x[],
666+ const PylithInt aOff[],
667+ const PylithInt aOff_x[],
668+ const PylithScalar a[],
669+ const PylithScalar a_t [],
670+ const PylithScalar a_x[],
671+ const PylithReal t,
672+ const PylithScalar x[],
673+ const PylithInt numConstants,
674+ const PylithScalar constants[],
675+ PylithReal* bulkDensity) {
681676 // Poroelastic Context
682677 pylith::fekernels::Poroelasticity::PoroelasticContext poroelasticContext;
683678 pylith::fekernels::Poroelasticity::setPoroelasticContextQS (
684679 &poroelasticContext, dim, numS, sOff , sOff_x , s, s_t , s_x, aOff, aOff_x, a, a_t , a_x, t, x);
685680
686681 bulkDensity = &(poroelasticContext.bulkDensity );
687682
688- } // bulkDensity_asScalar
683+ } // bulkDensity_asScalar
689684
690685 // =============================================================================
691686 // Velocity
0 commit comments