Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 10702)
+++ /issm/trunk/src/c/Makefile.am	(revision 10703)
@@ -529,6 +529,6 @@
 					     ./modules/IceVolumex/IceVolumex.h\
 					     ./modules/IceVolumex/IceVolumex.cpp\
-					     ./modules/RheologyBbarx/RheologyBbarx.cpp\
-					     ./modules/RheologyBbarx/RheologyBbarx.h\
+					     ./modules/ElementResponsex/ElementResponsex.h\
+					     ./modules/ElementResponsex/ElementResponsex.cpp\
 					     ./modules/MassFluxx/MassFluxx.cpp\
 					     ./modules/MassFluxx/MassFluxx.h
Index: /issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.cpp
===================================================================
--- /issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 10703)
+++ /issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.cpp	(revision 10703)
@@ -0,0 +1,52 @@
+/*!\file ElementResponsex
+ * \brief: compute element input  on one element only
+ */
+
+#include "./ElementResponsex.h"
+
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void ElementResponsex( double* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,int response_enum,bool process_units){
+	
+
+	extern int my_rank;
+	int i;
+
+	int found=0;
+	int sumfound=0;
+	int cpu_found=-1;
+	int index;
+	double response;
+	Element* element=NULL;
+
+	/*retrieve element we are interested in: */
+	parameters->FindParam(&index,IndexEnum);
+
+	/*now, go through our elements, and retrieve the one with this id: index: */
+	for(i=0;i<elements->Size();i++){
+		element=(Element*)elements->GetObjectByOffset(i);
+		if (element->Id()==index){
+			found=1;
+			cpu_found=my_rank;
+			break;
+		}
+	}
+
+	/*Broadcast whether we found the element: */
+	MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+	if(!sumfound)_error_("%s%i%s","could not find material with id",index," to compute ElementResponse");
+
+	/*Ok, we found the element, compute responseocity: */
+	if(my_rank==cpu_found){
+		element->ElementResponse(&response,response_enum,IuToExtEnum);
+	}
+
+	/*Broadcast and plug into response: */
+	MPI_Allreduce ( &cpu_found,&cpu_found,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
+	MPI_Bcast(&response,1,MPI_DOUBLE,cpu_found,MPI_COMM_WORLD); 
+
+	*presponse=response;
+}
Index: /issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.h
===================================================================
--- /issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.h	(revision 10703)
+++ /issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.h	(revision 10703)
@@ -0,0 +1,15 @@
+/*!\file:  ElementResponsex.h
+ * \brief header file for computing input average over one element
+ */ 
+
+#ifndef _ELEMENTRESPONSEX_H
+#define _ELEMENTRESPONSEX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void ElementResponsex( double* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int response_enum,bool process_units);
+
+#endif  /* _ELEMENTRESPONSEX_H */
+
Index: /issm/trunk/src/c/modules/Responsex/Responsex.cpp
===================================================================
--- /issm/trunk/src/c/modules/Responsex/Responsex.cpp	(revision 10702)
+++ /issm/trunk/src/c/modules/Responsex/Responsex.cpp	(revision 10703)
@@ -43,5 +43,6 @@
 		case RheologyBbarAbsGradientEnum:RheologyBbarAbsGradientx( responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
 		case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters,process_units,weight_index); break;
-		case MaterialsRheologyBbarEnum:RheologyBbarx(responses, elements,nodes, vertices, loads, materials, parameters,process_units); break;
+		case MaterialsRheologyBbarEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,MaterialsRheologyBbarEnum,process_units); break;
+		case VelEnum:ElementResponsex(responses, elements,nodes, vertices, loads, materials, parameters,VelEnum,process_units); break;
 		case FrictionCoefficientEnum:NodalValuex(responses, FrictionCoefficientEnum,elements,nodes, vertices, loads, materials, parameters,process_units); break;
 		default: _error_(" response descriptor \"%s\" not supported yet!",response_descriptor); break;
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 10702)
+++ /issm/trunk/src/c/modules/modules.h	(revision 10703)
@@ -66,4 +66,5 @@
 #include "./MaxAbsVzx/MaxAbsVzx.h"
 #include "./MaxVelx/MaxVelx.h"
+#include "./ElementResponsex/ElementResponsex.h"
 #include "./MaxVxx/MaxVxx.h"
 #include "./MaxVyx/MaxVyx.h"
@@ -99,5 +100,4 @@
 #include "./ResetCoordinateSystemx/ResetCoordinateSystemx.h"
 #include "./Responsex/Responsex.h"
-#include "./RheologyBbarx/RheologyBbarx.h"
 #include "./RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.h"
 #include "./Scotchx/Scotchx.h"
Index: /issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Element.h	(revision 10702)
+++ /issm/trunk/src/c/objects/Elements/Element.h	(revision 10703)
@@ -83,5 +83,5 @@
 		virtual void   MaxAbsVz(double* pmaxabsvz, bool process_units)=0;
 		virtual double MassFlux(double* segment,bool process_units)=0;
-		virtual double RheologyBbarx(void)=0;
+		virtual void   ElementResponse(double* presponse,int response_enum,bool process_units)=0;
 		virtual double IceVolume(void)=0;
 		virtual int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 10702)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 10703)
@@ -2862,32 +2862,4 @@
 }
 /*}}}*/
-/*FUNCTION Penta::RheologyBbarx{{{1*/
-double Penta::RheologyBbarx(void){
-
-	double Bbar;
-	Penta* base=NULL;
-	
-	/*We here compute the vertically averaged Bbar. To do so, we go to the 
-	 * base element under this one, and call this->InputDepthAverageAtBase:*/
-		
-	base=this;
-
-	if(!base->IsOnBed()){
-
-		for(;;){
-			base=base->verticalneighbors[0];
-			if(base->IsOnBed())break;
-		}
-	}
-
-	/*We have found the base under this. Call InputDepthAverageAtBase on it: */
-	base->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
-
-	/*Ok, base->matice now has the Bbar. Ask Bbar from this enum: */
-	Bbar=base->matice->GetBbar();
-
-	return Bbar;
-}
-/*}}}*/
 /*FUNCTION Penta::NodalValue {{{1*/
 int    Penta::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){
@@ -3068,4 +3040,31 @@
 	/*Assign output pointers:*/
 	*pmaxvz=maxvz;
+}
+/*}}}*/
+/*FUNCTION Penta::ElementResponse{{{1*/
+void Penta::ElementResponse(double* presponse,int response_enum,bool process_units){
+
+	switch(response_enum){
+		case MaterialsRheologyBbarEnum:
+			*presponse=this->matice->GetBbar();
+			break;
+		case VelEnum:
+
+			/*Get input:*/
+			double vel;
+			Input* vel_input;
+
+			vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
+			vel_input->GetInputAverage(&vel);
+
+			/*process units if requested: */
+			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
+
+			/*Assign output pointers:*/
+			*presponse=vel;
+		default:  
+			_error_("Response type %s not supported yet!",EnumToStringx(response_enum));
+	}
+
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 10702)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 10703)
@@ -125,5 +125,4 @@
 		void   MinVy(double* pminvy, bool process_units);
 		void   MinVz(double* pminvz, bool process_units);
-		double RheologyBbarx(void);
 		int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
 		double MassFlux(double* segment,bool process_units);
@@ -132,4 +131,5 @@
 		void   MaxAbsVz(double* pmaxabsvz, bool process_units);
 		void   MaxVel(double* pmaxvel, bool process_units);
+		void   ElementResponse(double* presponse,int response_enum,bool process_units);
 		void   MaxVx(double* pmaxvx, bool process_units);
 		void   MaxVy(double* pmaxvy, bool process_units);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 10702)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 10703)
@@ -2634,8 +2634,28 @@
 }
 /*}}}*/
-/*FUNCTION Tria::RheologyBbarx{{{1*/
-double Tria::RheologyBbarx(void){
-
-	return this->matice->GetBbar();
+/*FUNCTION Tria::ElementResponse{{{1*/
+void Tria::ElementResponse(double* presponse,int response_enum,bool process_units){
+
+	switch(response_enum){
+		case MaterialsRheologyBbarEnum:
+			*presponse=this->matice->GetBbar();
+			break;
+		case VelEnum:
+
+			/*Get input:*/
+			double vel;
+			Input* vel_input;
+
+			vel_input=this->inputs->GetInput(VelEnum); _assert_(vel_input);
+			vel_input->GetInputAverage(&vel);
+
+			/*process units if requested: */
+			if(process_units) vel=UnitConversion(vel,IuToExtEnum,VelEnum);
+
+			/*Assign output pointers:*/
+			*presponse=vel;
+		default:  
+			_error_("Response type %s not supported yet!",EnumToStringx(response_enum));
+	}
 
 }
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 10702)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 10703)
@@ -123,5 +123,4 @@
 		void   MinVy(double* pminvy, bool process_units);
 		void   MinVz(double* pminvz, bool process_units);
-		double RheologyBbarx(void);
 		int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
 		double MassFlux(double* segment,bool process_units);
@@ -129,4 +128,5 @@
 		void   MaxAbsVy(double* pmaxabsvy, bool process_units);
 		void   MaxAbsVz(double* pmaxabsvz, bool process_units);
+		void   ElementResponse(double* presponse,int response_enum,bool process_units);
 		void   MaxVel(double* pmaxvel, bool process_units);
 		void   MaxVx(double* pmaxvx, bool process_units);
Index: /issm/trunk/src/m/classes/qmu.m
===================================================================
--- /issm/trunk/src/m/classes/qmu.m	(revision 10702)
+++ /issm/trunk/src/m/classes/qmu.m	(revision 10703)
@@ -126,5 +126,5 @@
 			end
 			for i=1:numel(obj.params)
-				disp(sprintf('         qmu_params%s:  (array of method-independent parameters)',...
+				disp(sprintf('         params%s:  (array of method-independent parameters)',...
 					string_dim(obj.params,i)));
 				fnames=fieldnames(obj.params(i));
Index: /issm/trunk/src/m/usr/larour/Alias/cdhal.m
===================================================================
--- /issm/trunk/src/m/usr/larour/Alias/cdhal.m	(revision 10703)
+++ /issm/trunk/src/m/usr/larour/Alias/cdhal.m	(revision 10703)
@@ -0,0 +1,1 @@
+cd([issmdir '/projects/HalkidesJks2011']);
