예제 #1
0
def transfer_displacements(mesh, disp, comp):
    """
    Perform displacement transfer.

    Apply the computed displacements on the original mesh to obtain
    the deformed mesh.

    Parameters
    ----------
    mesh[nx, ny, 3] : numpy array
        Flattened array defining the lifting surfaces.
    disp[ny, 6] : numpy array
        Flattened array containing displacements on the FEM component.
        Contains displacements for all six degrees of freedom, including
        displacements in the x, y, and z directions, and rotations about the
        x, y, and z axes.
    comp : Either OpenAeroStruct component object (better), or surface dict.

    Returns
    -------
    def_mesh[nx, ny, 3] : numpy array
        Flattened array defining the lifting surfaces after deformation.
    """
    if not isinstance(comp, Component):
        surface = comp
        comp = TransferDisplacements(surface)
    params = {'mesh': mesh, 'disp': disp}
    unknowns = {'def_mesh': np.zeros((comp.nx, comp.ny, 3), dtype=data_type)}
    resids = None
    comp.solve_nonlinear(params, unknowns, resids)
    def_mesh = unknowns.get('def_mesh')
    return def_mesh
예제 #2
0
def transfer_displacements(mesh, disp, comp):
    """
    Perform displacement transfer.

    Apply the computed displacements on the original mesh to obtain
    the deformed mesh.

    Parameters
    ----------
    mesh[nx, ny, 3] : numpy array
        Flattened array defining the lifting surfaces.
    disp[ny, 6] : numpy array
        Flattened array containing displacements on the FEM component.
        Contains displacements for all six degrees of freedom, including
        displacements in the x, y, and z directions, and rotations about the
        x, y, and z axes.
    comp : Either OpenAeroStruct component object (better), or surface dict.

    Returns
    -------
    def_mesh[nx, ny, 3] : numpy array
        Flattened array defining the lifting surfaces after deformation.
    """
    if not isinstance(comp, Component):
        surface = comp
        comp = TransferDisplacements(surface)
    params = {
        'mesh': mesh,
        'disp': disp
    }
    unknowns = {
        'def_mesh': np.zeros((comp.nx, comp.ny, 3), dtype=data_type)
    }
    resids = None
    comp.solve_nonlinear(params, unknowns, resids)
    def_mesh = unknowns.get('def_mesh')
    return def_mesh
예제 #3
0
<<<<<<< HEAD
    if not comp:
=======
    if not isinstance(comp, Component):
        surface = comp
>>>>>>> 7eefd15e6c26c95cbbd9f303d23ecb4716c2fea3
        comp = TransferDisplacements(surface)
    params = {
        'mesh': mesh,
        'disp': disp
    }
    unknowns = {
        'def_mesh': np.zeros((comp.nx, comp.ny, 3), dtype=data_type)
    }
    resids = None
    comp.solve_nonlinear(params, unknowns, resids)
    def_mesh = unknowns.get('def_mesh')
    return def_mesh


"""
<<<<<<< HEAD
--------------------------------------------------------------------------------

                                AERODYNAMICS

--------------------------------------------------------------------------------
From vlm.py: """


def vlm_geometry(def_mesh, surface=None, comp=None):