public double[] CalculateElementDisplacements(IXFiniteElement element, IVectorView globalDisplacementVector) { double[] elementNodalDisplacements = FreeDofOrdering.ExtractVectorElementFromSubdomain(element, globalDisplacementVector); SubdomainConstrainedDofOrderingBase.ApplyConstraintDisplacements(element, elementNodalDisplacements, Constraints); return(elementNodalDisplacements); }
} = true; // At first it is modified //TODO: This belongs in EquivalentLoadsAssembler //TODO: the constraintScalingFactor parameter is not used. public double[] CalculateElementIncrementalConstraintDisplacements(IElement element, double constraintScalingFactor)//QUESTION: would it be maybe more clear if we passed the constraintsDictionary as argument?? { var elementNodalDisplacements = new double[FreeDofOrdering.CountElementDofs(element)]; SubdomainConstrainedDofOrderingBase.ApplyConstraintDisplacements(element, elementNodalDisplacements, Constraints); return(elementNodalDisplacements); }
public double[] CalculateElementIncrementalConstraintDisplacements(IElement element, double constraintScalingFactor) { var elementNodalDisplacements = new double[FreeDofOrdering.CountElementDofs(element)]; SubdomainConstrainedDofOrderingBase.ApplyConstraintDisplacements(element, elementNodalDisplacements, Constraints); return(elementNodalDisplacements); }
//ADDED1 public IVector GetRHSFromSolutionWithInitialDisplacemntsEffect(IVectorView solution, IVectorView dSolution, Dictionary <int, Node> boundaryNodes, Dictionary <int, Dictionary <IDofType, double> > initialConvergedBoundaryDisplacements, Dictionary <int, Dictionary <IDofType, double> > totalBoundaryDisplacements, int nIncrement, int totalIncrements) { ////prosthiki print //ekteleseis_counter2 += 1; //string counter_data = ekteleseis_counter2.ToString(); //string path = string.Format(string2, counter_data); ////solution.WriteToFile(path); //double[] solution_data = new double[solution.Length]; //solution_data = solution.CopyToArray(); //WriteToFileVector(solution_data, path); var forces = Vector.CreateZero(FreeDofOrdering.NumFreeDofs); //TODO: use Vector foreach (Element element in Elements) { var localSolution = GetLocalVectorFromGlobalWithoutPrescribedDisplacements(element, solution); ImposePrescribedDisplacementsWithInitialConditionSEffect(element, localSolution, boundaryNodes, initialConvergedBoundaryDisplacements, totalBoundaryDisplacements, nIncrement, totalIncrements); var localdSolution = GetLocalVectorFromGlobalWithoutPrescribedDisplacements(element, dSolution); ImposePrescribed_d_DisplacementsWithInitialConditionSEffect(element, localdSolution, boundaryNodes, initialConvergedBoundaryDisplacements, totalBoundaryDisplacements, nIncrement, totalIncrements); element.ElementType.CalculateStresses(element, localSolution, localdSolution); if (element.ElementType.MaterialModified) { element.Subdomain.StiffnessModified = true; } var f = element.ElementType.CalculateForces(element, localSolution, localdSolution); FreeDofOrdering.AddVectorElementToSubdomain(element, f, forces); } return(forces); }
/// <summary> /// Implements equivalent method of <see cref="ISubdomain"/>. /// </summary> public double[] CalculateElementDisplacements(IElement element, IVectorView globalDisplacementVector) { var elementNodalDisplacements = new double[FreeDofOrdering.CountElementDofs(element)]; FreeDofOrdering.ExtractVectorElementFromSubdomain(element, globalDisplacementVector); SubdomainConstrainedDofOrderingBase.ApplyConstraintDisplacements(element, elementNodalDisplacements, Constraints); return(elementNodalDisplacements); }
/// <summary> /// Implements equivalent method of <see cref="ISubdomain"/>. /// </summary> public IVector GetRhsFromSolution(IVectorView solution, IVectorView dSolution) { var forces = Vector.CreateZero(FreeDofOrdering.NumFreeDofs); foreach (Element element in Elements) { double[] localSolution = CalculateElementDisplacements(element, solution); double[] localdSolution = CalculateElementDisplacements(element, dSolution); element.ElementType.CalculateStresses(element, localSolution, localdSolution); if (element.ElementType.MaterialModified) { element.Patch.StiffnessModified = true; } var f = element.ElementType.CalculateForces(element, localSolution, localdSolution); FreeDofOrdering.AddVectorElementToSubdomain(element, f, forces); } return(forces); }
public IVector GetRhsFromSolution(IVectorView solution, IVectorView dSolution) { var forces = Vector.CreateZero(FreeDofOrdering.NumFreeDofs); //TODO: use Vector foreach (Element element in Elements) { //var localSolution = GetLocalVectorFromGlobal(element, solution);//TODOMaria: This is where the element displacements are calculated //removeMaria //var localdSolution = GetLocalVectorFromGlobal(element, dSolution);//removeMaria //TODO: ElementType should operate with Vector instead of double[]. Then the ToRawArray() calls can be removed double[] localSolution = CalculateElementDisplacements(element, solution); double[] localdSolution = CalculateElementDisplacements(element, dSolution); element.ElementType.CalculateStresses(element, localSolution, localdSolution); if (element.ElementType.MaterialModified) { element.Subdomain.StiffnessModified = true; } var f = element.ElementType.CalculateForces(element, localSolution, localdSolution); FreeDofOrdering.AddVectorElementToSubdomain(element, f, forces); } return(forces); }
//ADDED1 public IVector GetRHSFromSolutionWithInitialDisplacementsEffect(IVectorView solution, IVectorView dSolution, Dictionary <int, INode> boundaryNodes, Dictionary <int, Dictionary <IDofType, double> > initialConvergedBoundaryDisplacements, Dictionary <int, Dictionary <IDofType, double> > totalBoundaryDisplacements, int nIncrement, int totalIncrements) { var forces = Vector.CreateZero(FreeDofOrdering.NumFreeDofs); //TODO: use Vector foreach (Element element in Elements) { var localSolution = GetLocalVectorFromGlobalWithoutPrescribedDisplacements(element, solution); ImposePrescribedDisplacementsWithInitialConditionSEffect(element, localSolution, boundaryNodes, initialConvergedBoundaryDisplacements, totalBoundaryDisplacements, nIncrement, totalIncrements); var localdSolution = GetLocalVectorFromGlobalWithoutPrescribedDisplacements(element, dSolution); ImposePrescribed_d_DisplacementsWithInitialConditionSEffect(element, localdSolution, boundaryNodes, initialConvergedBoundaryDisplacements, totalBoundaryDisplacements, nIncrement, totalIncrements); element.ElementType.CalculateStresses(element, localSolution, localdSolution); if (element.ElementType.MaterialModified) { element.Subdomain.StiffnessModified = true; } var f = element.ElementType.CalculateForces(element, localSolution, localdSolution); FreeDofOrdering.AddVectorElementToSubdomain(element, f, forces); } return(forces); }
public double[] CalculateElementDisplacements(Element element, IVectorView globalDisplacementVector)//QUESTION: would it be maybe more clear if we passed the constraintsDictionary as argument?? { double[] elementNodalDisplacements = FreeDofOrdering.ExtractVectorElementFromSubdomain(element, globalDisplacementVector); SubdomainConstrainedDofOrderingBase.ApplyConstraintDisplacements(element, elementNodalDisplacements, Constraints); return(elementNodalDisplacements); }
public double[] GetLocalVectorFromGlobalWithoutPrescribedDisplacements(Element element, IVectorView globalDisplacementVector) { double[] elementNodalDisplacements = FreeDofOrdering.ExtractVectorElementFromSubdomain(element, globalDisplacementVector); return(elementNodalDisplacements); }