  Barred structures are important in understanding galaxy evolution, but they
were not included explicitly in most dynamical models for nearby galaxies due
to their complicated morphological and kinematic properties. We modify the
triaxial orbit-superposition Schwarzschild implementation by Van den Bosch et
al. (2008) to include barred structures explicitly. The gravitational potential
is a combination of a spherical dark matter halo and stellar mass; with the 3D
stellar density distribution de-projected from the observed 2D image using a
two-component de-projection method, including an axisymmetric disk and a
triaxial barred bulge. We consider figure rotation of the galaxy with the bar
pattern speed as a free parameter. We validate the method by applying it to a
mock galaxy with IFU data created from an N-body simulation with a boxy/peanut
or X-shaped bar. Our model fits the observed 2D surface density and all
kinematic features well. The bar pattern speed is recovered well with a
relative uncertainty smaller than 10%. Based on the internal stellar orbit
distribution of the model, we decompose the galaxy into an X-shaped bar, a boxy
bulge, a vertically extended structure and a disk, and demonstrate that our
model recovers these structures generally well, similar to the true structures
in the N-body simulation. Our method provides a realistic way of modelling the
bar structure explicitly for nearby barred galaxies with IFU observations.
