1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
\subsection{Bidimensional mesh with {\tt bamg}}
% =============================================
\label{sec-bamg}%
\pindex{bamg}%
\pindex{bamg2geo}%
\fiindex{\filesuffix{.bamg} bamg mesh}%
\fiindex{\filesuffix{.bamgcad} bamg geometry}%
\fiindex{\filesuffix{.geo} mesh}%
\fiindex{\filesuffix{.dmn} domain names}%
We first create a \reffile{square.bamgcad} file:
\myexamplenocxx{square.bamgcad}%
This is an uniform mesh with element size \var{h} = 0.1.
We refer to the \code{bamg} documentation~\cite{Hec-2006-bamg} for the
complete file format description.
Next, enter the mesh generator commands:
\begin{verbatim}
bamg -g square.bamgcad -o square.bamg
\end{verbatim}
Then, create the file \reffile{square.dmn} that associate names to the
four boundary domains of the mesh. Here, there is four boundary
domains:
\myexamplenocxx{square.dmn}%
and enter the translation command:
\begin{verbatim}
bamg2geo square.bamg square.dmn > square.geo
\end{verbatim}
This command creates a \file{square.geo} file.
Look at the mesh via the command:
\begin{verbatim}
geo square
\end{verbatim}
\pindex{gnuplot}%
\pindex{paraview}%
\pindexopt{geo}{-paraview}%
This presents the mesh it in a graphical form, usually
with \code{paraview}. You can switch to the \code{gnuplot} render:
\begin{verbatim}
geo square -gnuplot
\end{verbatim}
A finer mesh could be generated by:
\begin{verbatim}
bamg -coef 0.5 -g square.bamgcad -o square-0.5.bamg
\end{verbatim}
% ------------------
% no more supported:
%- -----------------
% \cindex{region}%
% One inconvenience of \code{bamg} is that it does not provide multi-region support.
% However, if the two regions desired in a mesh are separated with a boundary named, e.g.,
% \code{interface}, and that there exists another boundary domain in the mesh which is away
% from one of the regions, say \code{top}, \code{rheolef} can label the two regions and create two
% domains for them:
% \begin{verbatim}
% omega.build_subregion(omega["top"],omega["interface"],"north","south");
% \end{verbatim}
% where region \code{north} will have domain \code{top} in its boundary, while region \code{south}
% is away from it, and separated from \code{north} by \code{interface}.
% To do this,
% the file \reffile{square.dmn} can be modified to have 5 domain names, appending the name \code{interface},
% and the file \reffile{square.bamgcad} can be modified in this way:
% \myexamplenocxx{square-cut.bamgcad}
%
% The domains \code{omega["north"]} and \code{omega["south"]} can be used in the same way as is done
% in section~\ref{sec-transmission}.
%
|