Esempio n. 1
0
    def get_fargs_eval( self, diff_var = None, chunk_size = None, **kwargs ):
        if diff_var is not None:
            raise StopIteration
        
        mat, par_v, par_s = self.get_args( **kwargs )
        aps, vgs = par_s.get_approximation( self.get_current_group(),
                                            'Volume' )
        apv, vgv = par_v.get_approximation( self.get_current_group(),
                                            'Volume' )
        self.set_data_shape( aps, apv )

        cache = self.get_cache( 'cauchy_strain', 0 )
        strain = cache( 'strain', self.get_current_group(), 0,
                        state = par_v, get_vector = self.get_vector )
        cache = self.get_cache( 'grad_scalar', 0 )
        p_grad = cache( 'grad', self.get_current_group(), 0, state = par_s )

        n_qp = self.data_shape_r[1]
        mat = nm.asarray( mat, dtype = nm.float64 )
        mat = fix_mat_shape( mat, n_qp )

        return (strain, p_grad, mat, vgv), (chunk_size, 1, 1, 1), 0
Esempio n. 2
0
    def get_fargs_grad( self, diff_var = None, chunk_size = None, **kwargs ):
        mat, virtual, state = self.get_args( **kwargs )

        apr, vgr = virtual.get_approximation( self.get_current_group(),
                                              'Volume' )
        apc, vgc = state.get_approximation( self.get_current_group(),
                                            'Volume' )

        self.set_data_shape( apr, apc )
        shape, mode = self.get_shape_grad( diff_var, chunk_size )

        aux = nm.array( [0], ndmin = 4, dtype = nm.float64 )
        if diff_var is None:
            cache = self.get_cache( 'grad_scalar', 0 )
            p_grad = cache( 'grad', self.get_current_group(), 0, state = state )
        else:
            p_grad  = aux

        n_qp = self.data_shape_r[1]
        mat = nm.asarray( mat, dtype = nm.float64 )
        mat = fix_mat_shape( mat, n_qp )

        return (aux, p_grad, mat, vgr), shape, mode
Esempio n. 3
0
    def get_fargs_div( self, diff_var = None, chunk_size = None, **kwargs ):
        mat, state, virtual = self.get_args( **kwargs )

        apr, vgr = virtual.get_approximation( self.get_current_group(),
                                              'Volume' )
        apc, vgc = state.get_approximation( self.get_current_group(),
                                            'Volume' )

        self.set_data_shape( apr, apc )
        shape, mode = self.get_shape_div( diff_var, chunk_size )

        aux = nm.array( [0], ndmin = 4, dtype = nm.float64 )
        if diff_var is None:
            cache = self.get_cache( 'cauchy_strain', 0 )
            strain = cache( 'strain', self.get_current_group(), 0,
                            state = state, get_vector = self.get_vector )
        else:
            strain = aux

        n_qp = self.data_shape_r[1]
        mat = nm.asarray( mat, dtype = nm.float64 )
        mat = fix_mat_shape( mat, n_qp )

        return (strain, aux, mat, vgc), shape, mode + 2