[cig-commits] commit: More work on cohesive cell figure.

Mercurial hg at geodynamics.org
Tue Mar 27 21:11:50 PDT 2012


changeset:   88:78a253a2443f
tag:         tip
user:        Brad Aagaard <baagaard at usgs.gov>
date:        Tue Mar 27 21:11:40 2012 -0700
files:       figs/cohesivecell.tex figs/generatefigs.sh
description:
More work on cohesive cell figure.


diff -r 50f054baa891 -r 78a253a2443f figs/cohesivecell.tex
--- a/figs/cohesivecell.tex	Tue Mar 27 18:54:32 2012 -0700
+++ b/figs/cohesivecell.tex	Tue Mar 27 21:11:40 2012 -0700
@@ -1,29 +1,50 @@
 \documentclass{article}
+\usepackage{helvet}
+\renewcommand{\familydefault}{phv}
+
+\makeatletter
+\renewcommand{\large}{\@setfontsize\large{10}{9}}
+\renewcommand{\normalsize}{\@setfontsize\normalsize{8}{9.5}}
+\makeatother
+
 \usepackage{tikz}
 
 \begin{document}
-
+\pagestyle{empty}
 
 \input{figcolors}
+\pgfdeclarelayer{background}
+\pgfsetlayers{background,main}
+
 
 \begin{tikzpicture}
 
 \usetikzlibrary{shapes,fit,calc}%
 
-\tikzstyle{title}=[text width=37mm,font=\bfseries]
+\colorlet{colpositive}{red}
+\colorlet{colnegative}{blue}
+\colorlet{collagrange}{orange}
+\colorlet{colother}{mdslate}
 
+\tikzstyle{title}=[text width=37mm,font=\bfseries\large]
 
-\tikzstyle{vertex}=[circle,color=mdslate,fill=mdslate,inner sep=1.5pt]
+\tikzstyle{vertex}=[circle,color=colother,fill=mdslate,inner sep=1.5pt]
 
-\tikzstyle{vertexf}=[circle,color=red,fill=red,inner sep=1.5pt]
-\tikzstyle{vertexp}=[circle,color=red,fill=red,inner sep=1.5pt]
-\tikzstyle{vertexn}=[circle,color=blue,fill=blue,inner sep=1.5pt]
-\tikzstyle{vertexl}=[circle,color=orange,fill=orange,inner sep=1.5pt]
+\tikzstyle{vertexf}=[circle,color=colpositive,fill=red,inner sep=1.5pt]
+\tikzstyle{vertexp}=[circle,color=colpositive,fill=red,inner sep=1.5pt]
+\tikzstyle{vertexn}=[circle,color=colnegative,fill=blue,inner sep=1.5pt]
+\tikzstyle{vertexl}=[circle,color=collagrange,fill=collagrange,inner sep=1.5pt]
+
+\tikzstyle{fsurfp}=[color=colpositive,very thick]
+\tikzstyle{fsurfn}=[color=colnegative,very thick]
+
 
 \tikzstyle{cell}=[color=black]
 
-\tikzstyle{cellp}=[fill=red,opacity=0.25]
-\tikzstyle{celln}=[fill=blue,opacity=0.25]
+\tikzstyle{cellp}=[fill=colpositive!30]
+\tikzstyle{celln}=[fill=colnegative!30]
+
+\tikzstyle{classify}=[font=\bfseries\large]
 
 % Reference points
 \coordinate (o1) at (-60mm,0mm);
@@ -68,8 +89,10 @@
 \draw [cell]  (v2) -- (v7) -- (v6) -- (v2);
 \draw [cell]  (v1) -- (v6) -- (v9) -- (v1);
 
-\node(fvlabel) [color=red] at ($ (o1)+(-10mm,-35mm) $) {fault vertex};
-\path [color=red,->] (fvlabel) edge [bend right] (v3);
+\draw [fsurfp] (v1) -- (v2) -- (v3);
+
+\node(tlabel) [color=colpositive] at ($ (o1)+(-10mm,-35mm) $) {fault vertex};
+\path [color=colpositive,->] (tlabel) edge [bend right] (v3);
 
 % ----------------------------------------------------------------------
 % Add vertices, create cohesive cell
@@ -90,29 +113,29 @@
 \node[vertexp] (v3) at ($ (o2)+(0mm,-15mm)+(2mm,0mm) $) {};
 
 % surface and edges
-\draw [color=red,very thick] (v1) -- (v2) -- (v3);
-\draw [color=blue,very thick] (v4) -- (v5) -- (v6);
+\draw [fsurfp] (v1) -- (v2) -- (v3);
+\draw [fsurfn] (v4) -- (v5) -- (v6);
 \draw [color=black] (v1) -- (v7) -- (v4);
 \draw [color=black] (v2) -- (v8) -- (v5);
 \draw [color=black] (v3) -- (v9) -- (v6);
 
 % Fault surface labels
-\node(fvlabel) [color=blue] at ($ (o2)+(-10mm,+25mm) $) {$S_{f-}$};
-\path [color=blue,->] (fvlabel.south) edge [bend right] ($ (o2)+(-2mm,+7.5mm) $);
+\node(tlabel) [color=colnegative] at ($ (o2)+(-10mm,+20mm) $) {$S_{f-}$};
+\path [color=colnegative,->] (tlabel.south) edge [bend right] ($ (o2)+(-2mm,+7.5mm) $);
 
-\node(fvlabel) [color=red] at ($ (o2)+(+10mm,+25mm) $) {$S_{f+}$};
-\path [color=red,->] (fvlabel.south) edge [bend left] ($ (o2)+(+2mm,+7.5mm) $);
+\node(tlabel) [color=colpositive] at ($ (o2)+(+10mm,+20mm) $) {$S_{f+}$};
+\path [color=colpositive,->] (tlabel.south) edge [bend left] ($ (o2)+(+2mm,+7.5mm) $);
 
 
 % Fault vertex labels
-\node(fvlabel) [text width=20mm,align=right,color=blue] at ($ (o2)+(-15mm,-25mm) $) {Vertex on negative side};
-\path [color=blue,->] (fvlabel.east) edge [bend right] (v6);
+\node(tlabel) [text width=25mm,color=colnegative] at ($ (o2)+(-10mm,-25mm) $) {Vertex on negative side};
+\path [color=colnegative,->] (tlabel.north east) edge [bend right] (v6);
 
-\node(fvlabel) [text width=20mm,align=right,color=orange] at ($ (o2)+(-5mm,-40mm) $) {Lagrange multiplier vertex};
-\path [color=orange,->] (fvlabel.east) edge [bend right] (v9);
+\node(tlabel) [text width=25mm,color=collagrange] at ($ (o2)+(-5mm,-35mm) $) {Lagrange multiplier vertex};
+\path [color=collagrange,->] (tlabel.north east) edge [bend right] (v9);
 
-\node(fvlabel) [text width=20mm,align=right,color=red] at ($ (o2)+(+5mm,-55mm) $) {Vertex on positive side};
-\path [color=red,->] (fvlabel.east) edge [bend right] (v3);
+\node(tlabel) [text width=25mm,color=colpositive] at ($(o2)+(0mm,-45mm) $) {Original fault vertex (positive side)};
+\path [color=colpositive,->] (tlabel.north east) edge [bend right] (v3);
 
 
 
@@ -158,12 +181,15 @@
 \node[vertex] (v13) at (p13) {};
 
 % surface and edges
-\draw [color=red,very thick] (v1) -- (v2) -- (v3);
-\draw [color=blue,very thick] (v4) -- (v5) -- (v6);
-\draw [color=black] (v1) -- (v7) -- (v4);
-\draw [color=black] (v2) -- (v8) -- (v5);
-\draw [color=black] (v3) -- (v9) -- (v6);
+\draw [color=colpositive,very thick] (v1) -- (v2) -- (v3);
+\draw [color=colnegative,very thick] (v4) -- (v5) -- (v6);
+% Don't draw edges of cohesive cell
+%\draw [color=black] (v1) -- (v7) -- (v4);
+%\draw [color=black] (v2) -- (v8) -- (v5);
+%\draw [color=black] (v3) -- (v9) -- (v6);
 
+
+\begin{pgfonlayer}{background}
 % cells
 \fill [celln] (p5) -- (p4) -- (p10) -- cycle;
 \fill [celln] (p6) -- (p5) -- (p11) -- cycle;
@@ -174,7 +200,20 @@
 \draw [cell] (p6) -- (p5) -- (p11) -- cycle;
 \draw [cell] (p1) -- (p2) -- (p12) -- cycle;
 \draw [cell] (p2) -- (p3) -- (p13) -- cycle;
+\end{pgfonlayer}
 
+\node [classify] at ($ 1/3*(p5)+1/3*(p4)+1/3*(p10) $) {-};
+\node [classify] at ($ 1/3*(p6)+1/3*(p5)+1/3*(p11) $) {-};
+\node [classify] at ($ 1/3*(p1)+1/3*(p2)+1/3*(p12) $) {+};
+\node [classify] at ($ 1/3*(p2)+1/3*(p3)+1/3*(p13) $) {+};
+
+
+% Fault vertex labels
+\node(tlabel) [text width=12mm,color=colnegative] at ($ (o3)+(-12mm,-25mm) $) {Cell on negative side};
+\path [color=colnegative,->] (tlabel.north) edge [bend left] ($ (v6)+(-5mm,+5mm) $);
+
+\node(tlabel) [text width=12mm,color=colpositive] at ($ (o3)+(+12mm,-25mm) $) {Cell on positive side};
+\path [color=colpositive,->] (tlabel.north) edge [bend right] ($ (v9)+(+5mm,+5mm) $);
 
 
 % ----------------------------------------------------------------------
@@ -230,12 +269,14 @@
 \node[vertex] (v17) at (p17) {};
 
 % surface and edges
-\draw [color=red,very thick] (v1) -- (v2) -- (v3);
-\draw [color=blue,very thick] (v4) -- (v5) -- (v6);
-\draw [color=black] (v1) -- (v7) -- (v4);
-\draw [color=black] (v2) -- (v8) -- (v5);
-\draw [color=black] (v3) -- (v9) -- (v6);
+\draw [color=colpositive,very thick] (v1) -- (v2) -- (v3);
+\draw [color=colnegative,very thick] (v4) -- (v5) -- (v6);
+% Don't draw edge of cohesive cells
+%\draw [color=black] (v1) -- (v7) -- (v4);
+%\draw [color=black] (v2) -- (v8) -- (v5);
+%\draw [color=black] (v3) -- (v9) -- (v6);
 
+\begin{pgfonlayer}{background}
 % cells
 \fill [celln] (p5) -- (p4) -- (p10) -- cycle;
 \fill [celln] (p6) -- (p5) -- (p11) -- cycle;
@@ -266,7 +307,22 @@
 \draw [cell] (p2) -- (p13) -- (p12) -- cycle;
 \draw [cell] (p1) -- (p12) -- (p15) -- cycle;
 \draw [cell] (p1) -- (p15) -- (p14) -- cycle;
+\end{pgfonlayer}
 
+\node [classify] at ($ 1/3*(p5)+1/3*(p4)+1/3*(p10) $) {-};
+\node [classify] at ($ 1/3*(p6)+1/3*(p5)+1/3*(p11) $) {-};
+\node [classify] at ($ 1/3*(p1)+1/3*(p2)+1/3*(p12) $) {+};
+\node [classify] at ($ 1/3*(p2)+1/3*(p3)+1/3*(p13) $) {+};
+
+\node [classify] at ($ 1/3*(p4)+1/3*(p14)+1/3*(p10) $) {-};
+\node [classify] at ($ 1/3*(p5)+1/3*(p10)+1/3*(p11) $) {-};
+\node [classify] at ($ 1/3*(p6)+1/3*(p11)+1/3*(p16) $) {-};
+\node [classify] at ($ 1/3*(p6)+1/3*(p16)+1/3*(p17) $) {-};
+
+\node [classify] at ($ 1/3*(p3)+1/3*(p17)+1/3*(p13) $) {+};
+\node [classify] at ($ 1/3*(p2)+1/3*(p13)+1/3*(p12) $) {+};
+\node [classify] at ($ 1/3*(p1)+1/3*(p12)+1/3*(p15) $) {+};
+\node [classify] at ($ 1/3*(p1)+1/3*(p15)+1/3*(p14) $) {+};
 
 \end{tikzpicture}
 \end{document}
diff -r 50f054baa891 -r 78a253a2443f figs/generatefigs.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/figs/generatefigs.sh	Tue Mar 27 21:11:40 2012 -0700
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+pgffiles=cohesivecell
+
+for f in $pgffiles; do
+  latex $f.tex && dvips -o $f.ps $f.dvi
+done
+
+cat <<EOF > eps.sed
+s/%!PS-Adobe-2.0/%!PS-Adobe-2.0 EPSF-2.0/g
+/%%DocumentPaperSizes: Letter/d
+/%%Pages: 1/d
+/%%PageOrder: Ascend/d
+EOF
+
+f=cohesivecell
+sed -e "s/%%BoundingBox: 0 0 612 792/%%BoundingBox: 72 400 600 760/g" $f.ps | sed -f eps.sed > $f.tmp
+
+for f in $pgffiles; do
+  sed -f eps.sed $f.tmp > $f.eps
+  epstopdf $f.eps
+  #rm $f.ps $f.tmp $f.eps
+done
+



More information about the CIG-COMMITS mailing list