public Tuple <double[], double[]> CalculateStresses(IElement element, double[] localTotalDisplacementsSuperElement, double[] localdDisplacementsSuperElement) { double[][] Delta = new double[nGaussPoints][]; double[] localTotalDisplacements = dofEnumerator.GetTransformedDisplacementsVector(localTotalDisplacementsSuperElement); // embedding //double[] localDisplacements = dofEnumerator.GetTransformedVector(localdDisplacementsSuperElement); // embedding Delta = this.UpdateCoordinateDataAndCalculateDisplacementVector(localTotalDisplacements); for (int i = 0; i < materialsAtGaussPoints.Length; i++) { materialsAtGaussPoints[i].UpdateMaterial(Delta[i]); } return(new Tuple <double[], double[]>(Delta[materialsAtGaussPoints.Length - 1], materialsAtGaussPoints[materialsAtGaussPoints.Length - 1].Tractions)); }
public Tuple <double[], double[]> CalculateStresses(IElement element, double[] localDisplacements, double[] localdDisplacements) { UpdateState(dofEnumerator.GetTransformedDisplacementsVector(localdDisplacements)); //TODO: Should calculate strains and update material as well //material.UpdateMaterial(strains); //TODO: Should calculate stresses as well return(new Tuple <double[], double[]>(new double[FREEDOM_DEGREE_COUNT], new double[FREEDOM_DEGREE_COUNT])); }
public double[] GetLocalDOFValues(Element hostElement, double[] hostDOFValues) { //if (transformation == null) // throw new InvalidOperationException("Requested embedded node values for element that has no embedded nodes."); //if (hostElementList == null) // throw new InvalidOperationException("Requested host element list for element that has no embedded nodes."); //int index = hostElementList.IndexOf(hostElement); //if (index < 0) // throw new ArgumentException("Requested host element is not inside host element list."); //double[] values = new double[transformation.Columns]; //int multiplier = hostElement.ElementType.DofEnumerator.GetDOFTypes(hostElement).SelectMany(d => d).Count(); //int vectorIndex = 0; //for (int i = 0; i < index; i++) // vectorIndex += isNodeEmbedded[i] ? 3 : multiplier; //Array.Copy(hostDOFValues, 0, values, vectorIndex, multiplier); //return (transformation * new Vector<double>(values)).Data; return(dofEnumerator.GetTransformedDisplacementsVector(hostDOFValues)); }