X-ray and neutron dynamical diffraction : theory and applications