Example #1
0
    def _mats_default( self ):

        # Material model construction
        mats = MATS1D5Bond( mats_phase1 = self.mats_m,
                            mats_phase2 = self.mats_f,
                            mats_ifslip = self.mats_b,
                            mats_ifopen = MATS1DElastic( E = 0 )   # elastic function of open - inactive
                            )
        return mats
Example #2
0
    def _get_mats_fb(self):

        # Material model construction
        return MATS1D5Bond(
            mats_phase1=MATS1DElastic(E=0),
            mats_phase2=self.mats_f,
            mats_ifslip=self.mats_b,
            mats_ifopen=MATS1DElastic(
                E=0)  # elastic function of open - inactive
        )
Example #3
0
def example():
    from ibvpy.api import \
        TStepper as TS, RTDofGraph, RTraceDomainListField, TLoop, \
        TLine, IBVPSolve as IS, DOTSEval, BCSlice
    from ibvpy.mesh.fe_grid import FEGrid
    from mathkit.mfn import MFnLineArray

    stiffness_concrete = 34000 * 0.03 * 0.03
    A_fiber = 1.
    E_fiber = 1.
    stiffness_fiber = E_fiber * A_fiber

    d = 2 * sqrt(Pi)
    tau_max = 0.1 * d * Pi
    G = 100
    u_max = 0.023
    f_max = 0.2
    mats_eval = MATS1D5Bond(mats_phase1=MATS1DElastic(E=stiffness_fiber),
                            mats_phase2=MATS1DElastic(E=0),
                            mats_ifslip=MATS1DPlastic(E=G,
                                                      sigma_y=tau_max,
                                                      K_bar=0.,
                                                      H_bar=0.),
                            mats_ifopen=MATS1DElastic(E=0))

    fets_eval = FETS1D52L4ULRH(mats_eval=mats_eval)
    domain = FEGrid(coord_max=(1., 0.2),
                    shape=(16, 1),
                    fets_eval=fets_eval)

    end_dof = domain[-1, 0, -1, 0].dofs[0, 0, 0]
    ts = TS(dof_resultants=True,
            sdomain=domain,
            # conversion to list (square brackets) is only necessary for slicing of
            # single dofs, e.g "get_left_dofs()[0,1]"
            bcond_list=[
                BCSlice(var='u', value=0., dims=[0],
                        slice=domain[:, :, :, -1]),
                BCSlice(var='u', value=0., dims=[1],
                        slice=domain[:, :, :, :]),
                BCSlice(var='f', value=f_max, dims=[0],
                        slice=domain[-1, 0, -1, 0])
            ],
            rtrace_list=[RTDofGraph(name='Fi,right over u_right (iteration)',
                                    var_y='F_int', idx_y=end_dof,
                                    var_x='U_k', idx_x=end_dof),
                         RTraceDomainListField(name='slip',
                                               var='slip', idx=0),
                         RTraceDomainListField(name='eps1',
                                               var='eps1', idx=0),
                         RTraceDomainListField(name='eps2',
                                               var='eps2', idx=0),
                         RTraceDomainListField(name='shear_flow',
                                               var='shear_flow', idx=0),
                         RTraceDomainListField(name='sig1',
                                               var='sig1', idx=0),
                         RTraceDomainListField(name='sig2',
                                               var='sig2', idx=0),
                         RTraceDomainListField(name='Displacement',
                                               var='u', idx=0)
                         ])

    # Add the time-loop control
    tloop = TLoop(tstepper=ts, KMAX=30, debug=False,
                  tline=TLine(min=0.0, step=0.1, max=1.0))

    print(tloop.eval())
    # Put the whole stuff into the simulation-framework to map the
    # individual pieces of definition into the user interface.
    #
    from ibvpy.plugins.ibvpy_app import IBVPyApp
    app = IBVPyApp(ibv_resource=tloop)
    app.main()
Example #4
0
from mayavi.sources.api import VTKDataSource, VTKFileReader

from ibvpy.fets.fets1D5 import FETS1D52L4ULRH
from ibvpy.mats.mats1D import MATS1DElastic
from ibvpy.mats.mats1D5.mats1D5_bond import MATS1D5Bond
from ibvpy.mesh.fe_grid import FEGrid
from mathkit.matrix_la.sys_mtx_assembly import SysMtxAssembly
import numpy as np

if __name__ == '__main__':

    #=========================================================================
    # Material matrix
    #=========================================================================
    mats_eval = MATS1D5Bond(mats_phase1=MATS1DElastic(E=10.),
                            mats_phase2=MATS1DElastic(E=20.),
                            mats_ifslip=MATS1DElastic(E=5.),
                            mats_ifopen=MATS1DElastic(E=1.))
    D_el = np.diag(np.array([10., 0.1, 1., 10.]))
    n_s = D_el.shape[0]

    #=========================================================================
    # Element definition
    #=========================================================================
    fets_eval = FETS1D52L4ULRH(mats_eval=mats_eval)
    n_geo_r, n_dim_geo = fets_eval.geo_r.shape
    n_dof_r, n_dim_dof = fets_eval.dof_r.shape
    n_ip = fets_eval.n_gp
    n_el_dofs = n_dof_r * n_dim_dof

    #[ d, i]
    r_ip = fets_eval.ip_coords[:, :-1].T