Ejemplo n.º 1
0
 public double[] CalculateElementDisplacements(IXFiniteElement element, IVectorView globalDisplacementVector)
 {
     double[] elementNodalDisplacements =
         FreeDofOrdering.ExtractVectorElementFromSubdomain(element, globalDisplacementVector);
     SubdomainConstrainedDofOrderingBase.ApplyConstraintDisplacements(element, elementNodalDisplacements, Constraints);
     return(elementNodalDisplacements);
 }
Ejemplo n.º 2
0
        } = 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);
        }
Ejemplo n.º 3
0
        public double[] CalculateElementIncrementalConstraintDisplacements(IElement element, double constraintScalingFactor)
        {
            var elementNodalDisplacements = new double[FreeDofOrdering.CountElementDofs(element)];

            SubdomainConstrainedDofOrderingBase.ApplyConstraintDisplacements(element, elementNodalDisplacements, Constraints);
            return(elementNodalDisplacements);
        }
Ejemplo n.º 4
0
        //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);
        }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        //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);
        }
Ejemplo n.º 9
0
 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);
 }
Ejemplo n.º 10
0
 public double[] GetLocalVectorFromGlobalWithoutPrescribedDisplacements(Element element, IVectorView globalDisplacementVector)
 {
     double[] elementNodalDisplacements = FreeDofOrdering.ExtractVectorElementFromSubdomain(element, globalDisplacementVector);
     return(elementNodalDisplacements);
 }