a function that evaluates a Section

I have defined a function that returns different output according to the values of the axes of an ellipsoidal. The function is given below:

S[α1_, α2_, α3_, v_] :=
Module[{sortedargs},
sortedargs = SortBy[-# &][{α1, α2, α3}];
Print["Ellipsoidal axes ", " a1: ", α1, ", a2: ", α2,
", a3: ", α3];
Which[(*sphere*)α1 == α2 == α3,
Print["spherical inclusion"];
SMat = SSphere[α1, α2, α3, v];
Return[SMat],(*prolate spheroid*)(sortedargs[] ==
sortedargs[] && α3/α1 <= 1000),
Print["Prolate Spheroidal Inclusion"];
SMat = SProlateSpheroid[α1, α2, α3, v];
Return[SMat],(*oblate spheroid*)sortedargs[] == sortedargs[],
Print["Oblate Spheroidal Inclusion"];
SMat = SOblateSpheroid[α1, α2, α3, v];
Return[SMat], α3/α1 > 1000,
Print["cylindrical inclusion"];
SMat = SCylinder[α1, α2, α3, v];
Return[SMat],(*generic ellipsoid spheroid*)True,
Print["generic ellipsoid"];
SMat = SEllipsoidGen[α1, α2, α3, v];
Return[SMat]]]

What I want is if none of the Which statement cases is not satisfied then the function will evaluate the contents of a whole section within the same notebook (that actually contains several numerical integrations) and return as SMat the final output of this section.

How is it possible to do this?

Thank you very much!

• You can put that whole section into a Module, assign a name to it, like runSection := Module[{}, ...], and then add a last case to Which in the form of True, runSection. Sep 8 '15 at 12:47