# Implementing different integration rules for different fields

I am back with another issue that I couldn't solve, although trying different ways. The problem is in two-dimensional plane strain setup with hyperelasticity. The only degrees of freedom that I have are the displacements in horizontal and vertical directions. The element that I am using is the 9-node quadrilateral element (Q2) and I am using the Lobatto integration scheme (I will explain later why I am using Lobatto).

Now I would like to add another field to my problem named as $$\eta$$, which represents the volume fraction. So in the SMSTemplate I have

nNodes = 9;
SMSInitialize[
"CodeName", "Environment" -> "AceFEM"];
SMSTemplate["SMSTopology" -> "Q2", "SMSNoNodes" -> nNodes + 4,
"SMSDOFGlobal" -> Join[Table[2, nNodes], Table[1, 4]],
"SMSAdditionalNodes" -> Hold[{#1, #2, #3, #4} &],
"SMSNodeID" ->
Join[Table["D", nNodes], Table["LH", 4]], "SMSSymmetricTangent" -> False,
"SMSDefaultIntegrationCode" -> {32, 32}];


Note that the $$\{32,32\}$$ integration rule denotes the 9 node Lobatto scheme.

Now, as you saw, the special thing about the new degrees of freedom ($$\eta$$) is that they are located just on the corners and I would like to use bilinear elements to interpolate them, although the displacements fields are biquadratic. This is done due to some complementarity requirements in the problem that requires the integration of $$\eta$$ on nodal points only. This is the reason of using the Lobatto integration rule for the displacements.

For the sake of brevity, I skip the part of potential and go directly to the place where I calculate the residual. For calculating residual and tangent I use the following code

pe1 = Flatten[{uI, \[Eta]1I];
SMSDo[
Rg \[DoubleRightTee]
Jgd wgp (SMSD[\[Pi], pe1, i);
SMSExport[SMSResidualSign Rg, p$$[i], "AddIn" -> True]; SMSDo[ Kg \[DoubleRightTee] SMSD[Rg, pe1, j]; SMSExport[Kg, s$$[i, j], "AddIn" -> True];
, {j, SMSNoDOFGlobal}];
, {i, SMSNoDOFGlobal}];
SMSEndDo[];


Assuming that the rest of the code is fine, am I calculating the residual and tangent correctly? Should I calculate the residual obtained from displacement and $$\eta$$ separately? since one of the is on nine nodes and the other just on 4 nodes.

Is it possible to extend this to Gaussian integration for displacement (2*2*2) and 4-node Lobatto integration for $$\eta$$?