Beispiel #1
0
dRdX = np.zeros((sspr.nsdof))
for i in range(sspr.nterms):
    # Determine num quadrature point required for k-th
    # projection
    pc.initializeQuadrature(
        pc.getNumQuadraturePointsFromDegree(
            pc.basistermwise_parameter_degrees[i]))

    # Quadrature Loop
    for q in pc.quadrature_map.keys():
        # Quadrature node and weight
        yq = pc.Y(q, 'name')
        wq = pc.W(q)

        # Set the paramter values into the element
        dspr.setStiffness(yq['K'])

        # Create space for fetching deterministic
        # jacobian, and state vectors that go as input
        uq = np.zeros((1))  # dspr.nddof
        for k in range(sspr.nterms):
            psiky = pc.evalOrthoNormalBasis(k, q)
            uq[:] += U[k * 1:(k + 1) * 1] * psiky

        fq = dspr.F(uq)
        dfdxq = dspr.dFdk(uq)
        dRdxq = dspr.dRdk(uq)

        # Form u for this quadrature point 'y'
        # Project the determinic element jacobian onto the
        # stochastic basis and place in the global matrix