public override void Assemble(ref Vector F, Vector Fe) { int Ip, I1p, I1pi, I1; int NNPE = ElementNodes.Length; int NumberOFPhysics, TotalDoFPerNode; int[] DofPerPhysics; int[] StartIndexPerPhysics = Get_StartIndexForEachPhysics(out NumberOFPhysics, out TotalDoFPerNode, out DofPerPhysics); for (int p = 0; p < NNPE; p++) { Node_ND_Unknowns_MultiPhysics Unknowns_p = (Node_ND_Unknowns_MultiPhysics)ElementNodes[p].Unknowns; I1p = TotalDoFPerNode * p; for (int i = 0; i < NumberOFPhysics; i++) { I1pi = I1p + StartIndexPerPhysics[i]; for (int j = 0; j < DofPerPhysics[i]; j++) { I1 = I1pi + j; Ip = Unknowns_p.UnknownDoFs[PhysicsUsed[i]][j]; F.Values[Ip] += Fe.Values[I1]; } } } }
public override void Assemble(ref Matrix_Jagged K, Matrix_Jagged Ke) { int Ip, Iq, I1p, I1pi, I1, I2q, I2qk, I2; int NNPE = ElementNodes.Length; int NumberOFPhysics, TotalDoFPerNode; int[] DofPerPhysics; int[] StartIndexPerPhysics = Get_StartIndexForEachPhysics(out NumberOFPhysics, out TotalDoFPerNode, out DofPerPhysics); for (int p = 0; p < NNPE; p++) { Node_ND_Unknowns_MultiPhysics Unknowns_p = (Node_ND_Unknowns_MultiPhysics)ElementNodes[p].Unknowns; I1p = TotalDoFPerNode * p; for (int i = 0; i < NumberOFPhysics; i++) { I1pi = I1p + StartIndexPerPhysics[i]; for (int j = 0; j < DofPerPhysics[i]; j++) { I1 = I1pi + j; Ip = Unknowns_p.UnknownDoFs[PhysicsUsed[i]][j]; for (int q = 0; q < NNPE; q++) { Node_ND_Unknowns_MultiPhysics Unknowns_q = (Node_ND_Unknowns_MultiPhysics)ElementNodes[q].Unknowns; I2q = TotalDoFPerNode * q; for (int k = 0; k < NumberOFPhysics; k++) { I2qk = I2q + StartIndexPerPhysics[k]; for (int l = 0; l < DofPerPhysics[k]; l++) { I2 = I2qk + l; Iq = Unknowns_q.UnknownDoFs[PhysicsUsed[k]][l]; K.Values[Ip][Iq] += Ke.Values[I1][I2]; } } } } } } }