#each element
internalForces = lsd.readIntForcesDict(
    "/tmp/intForce_ULS_normalStressesResistance.json")
internalForcesValues = internalForces[2]
for key in internalForcesValues.keys():
    intForces = internalForcesValues[key]
    for f in intForces:
        nrow = 2 * (int(f.tagElem) - 1) + int(f.idSection)
        matIntForc[nrow] = np.array([float(f.N),
                                     float(f.Vy),
                                     float(f.Vz)])  #[Fx,Fy,Fz]

#We'll check the result of applying the coord. matrix to the vector of forces
#applied in the GCS is equal to the internal forces read from the file
#Local axes beam3dX
lAxBeamX = matrix_utils.matrixToNumpyArray(beam3dX.getLocalAxes(True))
#Loads [Fx,Fy,Fz] applied on the element (GCS)
FbeamXGCS = np.array([0, 0, F])
#internal forces read from the results file for elem1, section1
IFbeamXsec1 = matIntForc[0]
ratio1_0 = sum(np.dot(IFbeamXsec1, lAxBeamX) - FbeamXGCS)
#internal forces read from the results file for elem1, section2
IFbeamXsec2 = matIntForc[1]
ratio1_1 = sum(np.dot(IFbeamXsec2, lAxBeamX) - FbeamXGCS)

#Local axes beam3dY
lAxBeamY = matrix_utils.matrixToNumpyArray(beam3dY.getLocalAxes(True))
#Loads [Fx,Fy,Fz] applied on the element (GCS)
FbeamYGCS = np.array([F, 0, 0])
#internal forces read from the results file for elem2, section1
IFbeamYsec1 = matIntForc[2]
Пример #2
0
integ = solutionStrategy.newIntegrator("eigen_integrator", xc.Vector([]))

soe = solutionStrategy.newSystemOfEqn("full_gen_eigen_soe")
solver = soe.newSolver("full_gen_eigen_solver")

analysis = solu.newAnalysis("modal_analysis", "solutionStrategy", "")
analOk = analysis.analyze(3)
periods = analysis.getPeriods()
angularFrequencies = analysis.getAngularFrequencies()
aceleraciones = [2.27, 2.45, 6.98]
crossCQCCoefficients = analysis.getCQCModalCrossCorrelationCoefficients(
    xc.Vector([0.05, 0.05, 0.05]))

from misc import matrix_utils
eigNod3 = nod3.getNormalizedEigenvectors
eigenvectors = matrix_utils.matrixToNumpyArray(eigNod3)
modos = eigenvectors[0:3, 0:3]  #eigenvectors.getBox(0,0,2,2)
modo1 = modos[:, 0]  #.getCol(1)
modo2 = modos[:, 1]  #.getCol(2)
modo3 = modos[:, 2]  #.getCol(3)

factoresParticipacionModalX = nod3.getModalParticipationFactorsForDOFs([0])
factoresDistribucion = nod3.getDistributionFactors
A1 = matrix_utils.vectorToNumpyArray(
    nod3.getMaxModalDisplacementForDOFs(1, aceleraciones[0], [0]))
maxDispMod1 = A1[0:3]  #getBox(A1,1,1,3,1)
A2 = matrix_utils.vectorToNumpyArray(
    nod3.getMaxModalDisplacementForDOFs(2, aceleraciones[1], [0]))
maxDispMod2 = A2[0:3]  #getBox(A2,1,1,3,1)
A3 = matrix_utils.vectorToNumpyArray(
    nod3.getMaxModalDisplacementForDOFs(3, aceleraciones[2], [0]))
Пример #3
0
                [-1, -1, +1], [1, -1, +1], [1, 1, +1], [-1, 1, +1]]

testValues = np.array([[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0],
                       [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0],
                       [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0],
                       [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1]])

resultNodes = list()
for nc in naturalCoord:
    values = brick.getShapeFunctionsValues(nc[0], nc[1], nc[2])
    row = list()
    for v in values:
        row.append(v)
    resultNodes.append(row)

err = LA.norm(np.array(resultNodes) - testValues)

# Verifies that Gauss Point i correspond to Node i
gaussPointsPositions = matrix_utils.matrixToNumpyArray(
    brick.gaussPointsPositions)
gaussPointsPositions *= math.sqrt(3.0)
err += LA.norm(np.array(gaussPointsPositions) - naturalCoord)

import os
from misc_utils import log_messages as lmsg
fname = os.path.basename(__file__)
if (err < 1e-20):
    print('test ' + fname + ': ok.')
else:
    lmsg.error(fname + ' ERROR.')