# Set up two problem regions, one for the cylinder # and one for the fibres $torso = 1; $intestine = 2; # Set up two problem classes - laplace for the cylinder # and activation for the fibres $laplace = 1; $active = 2; fem define para;r;intestine fem define coor;r;intestine fem define regi;r;intestine fem define nodes;r;fitted_new reg $intestine fem de base;r;intestine_torso fem define elements;r;fitted_new reg $intestine # Group the intestine element to apply different grid schemes later fem group elem 57,40,44,39,53,46,43,27,67,19,77,58,28,18 as grid10 reg $intestine fem group elem 38,72,62,29,31,84,41,45,61,68,82,79,69,49,91,66,83,51,80,64,92,75,33,86,74,2,23,36,87 as grid15 reg $intestine fem group elem 47,17,52,100,109,25,13,32,16,102,50,10,48,35,65,21,12,26,4,95,104,54,59,42,76 as grid20 reg $intestine fem group elem 14,107,34,20,11,90,37,73,110,7,71,101,108,105,5,63,55,6,96,97,70,93,78 as grid25 reg $intestine fem group elem 1,89,60,99,103,30,94,15,9,56,3 as grid30 reg $intestine fem group elem 88,8,85,106,81,98 as grid35 reg $intestine fem group elem 24,22 as grid40 reg $intestine # Generate a finite different grid over the intestine fem define grid;r;intestine reg $intestine fem update grid geometry reg $intestine fem update grid metric reg $intestine # Define the activation in the intestine fem define equ;r;ICCcmiss reg $intestine class $active fem define cell;r;ICCcmiss reg $intestine class $active fem define mate;r;ICCcmiss cell reg $intestine class $active fem define mate;r;ICCcmiss reg $intestine class $active fem update grid material reg $intestine class $active fem define init;r;ICCcmiss reg $intestine class $active fem define solv;r;ICCcmiss reg $intestine class $active fem export node;intestine as intestine reg $intestine class $active fem export ele;intestine reg $intestine class $active as intestine fem export ele;grid reg $intestine class $active as intestine grid_numbers # Perform an initial solve #fem solve reg $torso class $laplace fem solve to 0 reg $intestine class $active fem export ele;intestine_field0 reg $intestine class $active field as intestine; for $M ( 1..10) { $time=$M # Solve the grid problem fem solve restart to $time reg $intestine class $active; # Calculate the dipole sources #fem define sour;c grid # Apply the sources to the laplace problem #fem update sour reg $torso class $laplace # Solve the laplace problem #fem solve reg $torso class $laplace fem export ele;intestine_field$time reg $intestine class $active field as intestine; #fem write history time $time variables yqs binary; }