Consolidation of Clay and Compaction/Liquefaction of Sand -A Structure Theoretic Approach-