Adaptive hierarchical modeling of heterogeneous structures