Beispiel #1
0
def demo1d():

    # Geometry
    #
    length = 1.0

    # Material and FE Formulation
    #
    from ibvpy.fets.fets1D import FETS1D2L, FETS1D2L3U
    from ibvpy.mats.mats1D import MATS1DElastic

    mats_eval = MATS1DElastic(E=100.,
                              initial_strain=TemperatureLinFn(length=length,
                                                              n_dims=1,
                                                              offset=0.5))
    fets_eval = FETS1D2L3U(mats_eval=mats_eval)
    fets_eval.vtk_r *= 0.99

    # Discretization
    #
    domain = FEGrid(coord_max=(length, 0., 0.),
                    n_elems=(10, ),
                    fets_eval=fets_eval)

    bcond_list = [
        BCSlice(var='u', dims=[0], slice=domain[0, 0], value=0),
        #BCSlice( var = 'u', dims = [0], slice = domain[-1, -1], value = 0 )
    ]

    ts = TS(sdomain=domain,
            bcond_list=bcond_list,
            rtrace_list=[sig_trace, eps_trace, eps0_trace, eps1t_trace])

    # Time integration
    #
    tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0))

    tloop.eval()

    # Postprocessing
    #
    legend = []
    plot_sig(eps_trace, 'eps', legend)
    plot_sig(eps0_trace, 'eps0', legend)
    plot_sig(eps1t_trace, 'eps1t', legend)
    p.legend(legend)
    p.show()
Beispiel #2
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()
Beispiel #3
0
# Created on Oct 26, 2010 by: rch

from ibvpy.api import\
     BCSlice, TStepper as TS, TLoop, TLine, RTDofGraph
from ibvpy.rtrace.rt_domain_list_field import RTraceDomainListField
from ibvpy.mesh.fe_grid import FEGrid
from ibvpy.mesh.fe_refinement_grid import FERefinementGrid
from ibvpy.mesh.fe_domain import FEDomain

from ibvpy.mesh.fe_spring_array import FESpringArray
from ibvpy.fets.fets1D.fets1D2l import FETS1D2L
from ibvpy.mats.mats1D import MATS1DElastic

if __name__ == '__main__':

    fets_eval = FETS1D2L( mats_eval = MATS1DElastic( E = 1 ) )

    # Discretization
    fe_domain = FEDomain()

    fe_patch_left = FERefinementGrid( name = 'left',
                                     fets_eval = fets_eval,
                                     domain = fe_domain )

    fe_grid_left = FEGrid( level = fe_patch_left,
                      coord_min = ( 0., ),
                      coord_max = ( 1., ),
                      shape = ( 1, ),
                      fets_eval = fets_eval )

    fe_patch_right = FERefinementGrid( name = 'refinement grid',
Beispiel #4
0
 def _mats_phase2_default(self):
     return MATS1DElastic()
Beispiel #5
0
 def _mats_ifopen_default(self):
     return MATS1DElastic()
Beispiel #6
0
 def _mats_ifslip_default(self):
     return MATS1DElastic()
Beispiel #7
0
from envisage.ui.workbench.api import WorkbenchApplication
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