Exemplo n.º 1
0
        /// <summary>
        /// This method builds the boundary condition matrix and the number of true boundary conditions.
        /// </summary>
        /// <param name="beam"></param>
        /// <param name="degreesOfFreedom"></param>
        /// <returns>The boundary conditions matrix and the number of true boundary conditions.</returns>
        public async override Task <(bool[], uint)> CalculateBoundaryConditions(BeamWithDva <TProfile> beam, uint degreesOfFreedom)
        {
            uint numberOfDvas = (uint)beam.DvaNodePositions.Length;

            (bool[] boundaryCondition, uint numberOfTrueBoundaryConditions) = await base.CalculateBoundaryConditions(beam, degreesOfFreedom + numberOfDvas).ConfigureAwait(false);

            return(boundaryCondition, numberOfTrueBoundaryConditions);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method creates a new instance of class <see cref="BeamWithDva{TProfile}"/>.
        /// This is a step to create the input fot finite element analysis.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="degreesOfFreedom"></param>
        /// <returns>A new instance of class <see cref="Beam{TProfile}"/>.</returns>
        public override async Task <BeamWithDva <TProfile> > BuildBeam(BeamWithDvaRequest <TProfile> request, uint degreesOfFreedom)
        {
            double[] dvaMasses        = new double[request.Dvas.Count];
            double[] dvaStiffnesses   = new double[request.Dvas.Count];
            uint[]   dvaNodePositions = new uint[request.Dvas.Count];

            int i = 0;

            foreach (DynamicVibrationAbsorber dva in request.Dvas)
            {
                dvaMasses[i]        = dva.Mass;
                dvaStiffnesses[i]   = dva.Stiffness;
                dvaNodePositions[i] = dva.NodePosition;
                i += 1;
            }

            GeometricProperty geometricProperty = new GeometricProperty();

            if (request.Profile.Area != 0 && request.Profile.MomentOfInertia != 0)
            {
                geometricProperty.Area = await ArrayFactory.CreateVectorAsync(request.Profile.Area.Value, request.NumberOfElements).ConfigureAwait(false);

                geometricProperty.MomentOfInertia = await ArrayFactory.CreateVectorAsync(request.Profile.MomentOfInertia.Value, request.NumberOfElements).ConfigureAwait(false);
            }
            else
            {
                geometricProperty.Area = await this._geometricProperty.CalculateArea(request.Profile, request.NumberOfElements).ConfigureAwait(false);

                geometricProperty.MomentOfInertia = await this._geometricProperty.CalculateMomentOfInertia(request.Profile, request.NumberOfElements).ConfigureAwait(false);
            }

            var beam = new BeamWithDva <TProfile>()
            {
                DvaMasses         = dvaMasses,
                DvaNodePositions  = dvaNodePositions,
                DvaStiffnesses    = dvaStiffnesses,
                Fastenings        = await this._mappingResolver.BuildFastenings(request.Fastenings).ConfigureAwait(false),
                Forces            = await this._mappingResolver.BuildForceVector(request.Forces, degreesOfFreedom + (uint)request.Dvas.Count).ConfigureAwait(false),
                GeometricProperty = geometricProperty,
                Length            = request.Length,
                Material          = MaterialFactory.Create(request.Material),
                NumberOfElements  = request.NumberOfElements,
                Profile           = request.Profile
            };

            return(beam);
        }
Exemplo n.º 3
0
        /// <summary>
        /// This method calculates the mass matrix of beam with dynamic vibration absorber.
        /// </summary>
        /// <param name="beam"></param>
        /// <param name="degreesOfFreedom"></param>
        /// <returns>The strucutal mass matrix.</returns>
        public async override Task <double[, ]> CalculateMass(BeamWithDva <TProfile> beam, uint degreesOfFreedom)
        {
            double[,] beamMass = await base.CalculateMass(beam, degreesOfFreedom).ConfigureAwait(false);

            double[,] massWithDva = new double[beamMass.GetLength(0) + beam.DvaMasses.Length, beamMass.GetLength(1) + beam.DvaMasses.Length];

            for (int i = 0; i < beamMass.GetLength(0); i++)
            {
                for (int j = 0; j < beamMass.GetLength(1); j++)
                {
                    massWithDva[i, j] = beamMass[i, j];
                }
            }

            for (int i = 0; i < beam.DvaMasses.Length; i++)
            {
                massWithDva[2 * beam.DvaNodePositions[i], 2 * beam.DvaNodePositions[i]] += beam.DvaMasses[i];
                massWithDva[i + beamMass.GetLength(0), i + beamMass.GetLength(0)]        = beam.DvaMasses[i];
            }

            return(massWithDva);
        }