Commit 9f8f005d authored by Chris Cantwell's avatar Chris Cantwell

Added developer-guide repository as a submodule.

parent 0e9b34f1
......@@ -3,3 +3,8 @@
path = docs/tutorial
url = git@gitlab.nektar.info:nektar/tutorial
ignore = all
[submodule "docs/developer-guide"]
branch = master
path = docs/developer-guide
url = git@gitlab.nektar.info:nektar/developer-guide
ignore = all
Subproject commit e128cfaffbbd37c734a667cdc2a07b6f06291615
SET(DEVGUIDESRC ${CMAKE_CURRENT_SOURCE_DIR})
SET(DEVGUIDE ${CMAKE_BINARY_DIR}/docs/developer-guide)
FILE(MAKE_DIRECTORY ${DEVGUIDE}/html)
FIND_PROGRAM(HTLATEX htlatex)
ADD_CUSTOM_TARGET(developer-guide-html
export TEXINPUTS=${CMAKE_SOURCE_DIR}//:${DEVGUIDESRC}//: &&
${HTLATEX} ${DEVGUIDESRC}/developer-guide.tex
"${DEVGUIDESRC}/styling.cfg,html,3,next,NoFonts"
WORKING_DIRECTORY ${DEVGUIDE}/html
)
# If tex4ht successful, create img dir and copy images across
FILE(GLOB_RECURSE imgfiles "img/*.png" "img/*.jpg" "*/img/*.png" "*/img/*.jpg")
ADD_CUSTOM_COMMAND(TARGET developer-guide-html
POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${DEVGUIDE}/html/img)
FOREACH(img ${imgfiles})
ADD_CUSTOM_COMMAND(TARGET developer-guide-html
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${img} ${DEVGUIDE}/html/img)
ENDFOREACH()
FILE(GLOB_RECURSE pdffiles "*/img/*.pdf")
FIND_PROGRAM(CONVERT convert)
FOREACH(pdf ${pdffiles})
GET_FILENAME_COMPONENT(BASENAME ${pdf} NAME_WE)
ADD_CUSTOM_COMMAND(TARGET developer-guide-html
POST_BUILD COMMAND
${CONVERT} ${pdf} ${DEVGUIDE}/html/img/${BASENAME}.png)
ENDFOREACH()
FIND_PROGRAM(PDFLATEX pdflatex)
FIND_PROGRAM(BIBTEX bibtex)
FIND_PROGRAM(MAKEINDEX makeindex)
ADD_CUSTOM_TARGET(developer-guide-pdf
export TEXINPUTS=${CMAKE_SOURCE_DIR}//: &&
${PDFLATEX} --output-directory ${DEVGUIDE} ${DEVGUIDESRC}/developer-guide.tex
COMMAND TEXMFOUTPUT=${DEVGUIDE} ${BIBTEX} ${DEVGUIDE}/developer-guide.aux
COMMAND TEXMFOUTPUT=${DEVGUIDE} ${MAKEINDEX} ${DEVGUIDE}/developer-guide.idx
COMMAND TEXINPUTS=${CMAKE_SOURCE_DIR}//:
${PDFLATEX} --output-directory ${DEVGUIDE} ${DEVGUIDESRC}/developer-guide.tex
COMMAND TEXINPUTS=${CMAKE_SOURCE_DIR}//:
${PDFLATEX} --output-directory ${DEVGUIDE} ${DEVGUIDESRC}/developer-guide.tex
WORKING_DIRECTORY ${DEVGUIDESRC}
)
\chapter{Coding Standard}
The purpose of this page is to detail the coding standards of the project which
all contributers are requested to follow.
This page describes the coding style standard for C++. A coding style standard
defines the visual layout of source code. Presenting source code in a uniform
fashion facilitates the use of code by different developers. In addition,
following a standard prevents certain types of coding errors.
All of the items below, unless otherwise noted, are guidelines. They are
recommendations about how to lay out a given block of code. Use common sense and
provide comments to describe any deviation from the standard. Sometimes,
violating a guideline may actually improve readability.
If you are working with code that does not follow the standard, bring the code
up-to-date or follow the existing style. Don’t mix styles.
\section{Code Layout}
The aim here is to maximise readability on all platforms and editors.
\begin{itemize}
\item Code width of 80 characters maximum - hard-wrap longer lines.
\item Use sensible wrapping for long statements in a way which maximises
readability.
\item Do not put multiple statements on the same line.
\item Do not declare multiple variables on the same line.
\item Provide a default value on all variable declarations.
\item Enclose every program block (if, else, for, while, etc) in braces, even if
empty or just a single line.
\item Opening braces (\{) should be on their own line.
\item Braces at same indentation as preceeding statement.
\item One class per .cpp and .h file only, unless nested.
\item Define member functions in the .cpp file in the same order as defined in
the .h file.
\item Templated classes defined and implemented in a single .hpp file.
\item Do not put inline functions in the header file unless the function is
trivial (e.g. accessor, empty destructor), or profiling explicitly suggests to.
\item Inline functions should be declared within the class declaration but
defined outside the class declaration at the bottom of the header file.
\begin{notebox}
Virtual and inline are mutually exclusive. Virtual functions should therefore be
implemented in the .cpp file.
\end{notebox}
\end{itemize}
\section{Space}
Adding an appropriate amount of white space enhances readability. Too much white
space, on the other hand, detracts from that readability.
\begin{itemize}
\item Indent using a four-space tab. Consistent tab spacing is necessary to
maintain formatting. Note that this means when a tab is pressed, four physical spaces are
inserted into the source instead.
\item Put a blank line at the end of a public/protected/private block.
\item Put a blank line at the end of every file.
\item Put a space after every keyword (if, while, for, etc.).
\item Put a space after every comma, unless the comma is at the end of the line.
\item Do not put a space before the opening parenthesis of an argument list to a
function.
\item Declare pointers and references with the * or \& symbol next to the
declarator, not the type; e.g., Object *object. Do not put multiple variables in the same
declaration.
\item Place a space on both sides of a binary operator.
\item Do not use a space to separate a unary operator from its operand.
\item Place open and close braces on their own line. No executable statements
should appear on the line with the brace, but comments are allowed. Indent opening
braces at the same level as the statement above and indent the closing brace at
the same level as the corresponding opening brace.
\item Indent all statements following an open brace by one tab. Developer Studio
puts any specifier terminated with a colon at the same indentation level as the
enclosing brace. Examples of such specifiers include case statements, access
specifiers (public, private, protected), and goto labels. This is not acceptable
and should be manually corrected so that all statements appearing within a block
and delineated by braces are indented.
\item Break a line into multiple lines when it becomes too long to read. Use at
least two tabs to start the new line, so it does not look like the start of a
block.
\item Follow C++ style comments with one space. It is also preferable to
consider any text that follows C++ style comments as a sentence and to begin this text
with a capital letter. This helps to distinguish the line from a continuation of
a previous line; i.e., \inlsh{// This is my comment.}
\item As a general rule, don’t keep commented out source code in the final
baselined product. Such code leads the reader to believe there was uncertainty
in the code as it currently exists.
\item Place the \# of a preprocessor directive at column one. An exception is
the use of nested ifdefs where the bodies only contain other preprocessor directives.
Add tabs to enhance readability:
\begin{lstlisting}[style=C++Style]
void foo() {
for(int i = 0; i < 10; ++i)
{
#ifdef BAR
do_something();
#endif
for_loop_code();
}
}
\end{lstlisting}
\item Use tabular white space if it enhances
readability.
\item Use only one return statement. Structure the code so that only one return
statement is necessary.
\end{itemize}
\section{Naming Conventions}
Keep variable and function names meaningful but concise.
\begin{itemize}
\item Begin variable names with lower-case letter.
\item Begin function names and class names with upper-case letter.
\item All function, class and variable names should be written in CamelCase,
e.g. \inlsh{MyClass, DoFunction() or myVariableName}.
\item All preprocessor definitions written in UPPER\_CASE with words separated
by underscores, e.g. USE\_SPECIFIC\_FEATURE.
\item All member variables prefixed with m\_.
\item All constants prefixed with a k.
\item All function parameters prefixed with a p.
\item All enumerations prefixed with an e.
\item Do not use leading underscores.
\end{itemize}
\section{Namespaces}
The top-level namespace is "Nektar". All code should reside in this namespace or
a sub-space of this.
\begin{itemize}
\item Namespaces correspond to code structure.
\item Namespaces should be kept to a minimum to simplify the interface to their
contents.
\end{itemize}
\section{Documentation}
\begin{itemize}
\item Briefs for classes, functions and types in header files using
\inlsh{///} notation.
\item Full documentation with implementation using \inlsh{/** ... *\/}
notation.
\item Use @ symbol for @class, @param, @returns, etc for ease of identification.
\item Any separate documentation pages not directly associated with a portion of
the code should be in a separate file in /docs/html/doxygen.
\end{itemize}
This diff is collapsed.
\chapter{Data Structures and Algorithms}
\label{ch:data}
\input{connectivity}
\input{time-integration}
\input{preconditioners}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% memoir.4ht 2009-05-21-09:32 %
% Copyright (C) 2003--2009 Eitan M. Gurari %
% %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3c of this license or (at your option) any %
% later version. The latest version of this license is %
% in %
% http://www.latex-project.org/lppl.txt %
% and version 1.3c or later is part of all distributions %
% of LaTeX version 2005/12/01 or later. %
% %
% This work has the LPPL maintenance status "maintained".%
% %
% This Current Maintainer of this work %
% is Eitan M. Gurari. %
% %
% If you modify this program your changing its signature %
% with a directive of the following form will be %
% appreciated. %
% \message{signature} %
% %
% gurari@cse.ohio-state.edu %
% http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2009-05-21-09:32}
\input book.4ht
\input verse.4ht
% Tables Handling
\input array.4ht
\input dcolumn.4ht
\input tabularx.4ht
\input booktabs.4ht
\let\rm\empty
\let\sf\empty
\let\tt\empty
\let\bf\empty
\let\it\empty
\def\@chapter[#1]#2{%
\gHAdvance\:mpNum by 1
\HAssign\minipageNum=\:mpNum \relax
%
{\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}%
\global\let\f@rtoc\f@rtoc
\global\let\f@rhdr\f@rhdr }%
\HtmlEnv \Toc:Title{#1}\:chapter{#2}}
\NewConfigure{poemline}{2}
\ifx \memgobble\:UnDef
\pend:defI\getthelinenumber{%
\let\sv:thepoemline\thepoemline
\pend:def\thepoemline{\a:poemline}%
\append:def\thepoemline{\b:poemline}}
\append:defI\getthelinenumber{\let\thepoemline\sv:thepoemline}
\else
\pend:defII\getthelinenumber{%
\let\sv:thepoemline\thepoemline
\pend:def\thepoemline{\a:poemline}%
\append:def\thepoemline{\b:poemline}}
\append:defII\getthelinenumber{\let\thepoemline\sv:thepoemline}
\fi
\Hinput{memoir}
\endinput
\Preamble{html}
\Configure{graphics*}
{pdf}
{\Picture[pict]{\csname Gin@base\endcsname.png}}
%% Use HTML for italics and bold
\Configure{emph}{\ifvmode\ShowPar\fi\HCode{<em>}}{\HCode{</em>}}
\Configure{textbf}{\ifvmode\ShowPar\fi\HCode{<b>}}{\HCode{</b>}}
\Configure{texttt}{\ifvmode\ShowPar\fi\HCode{<code>}}{\HCode{</code>}}
\ConfigureEnv{notebox}{\ifvmode\ShowPar\fi\HCode{<div class="notebox">}}{\HCode{</div>}} {} {}
\ConfigureEnv{warningbox}{\ifvmode\ShowPar\fi\HCode{<div class="warningbox">}}{\HCode{</div>}} {} {}
\ConfigureEnv{tipbox}{\ifvmode\ShowPar\fi\HCode{<div class="tipbox">}}{\HCode{</div>}} {} {}
%% Remove div indents
\Configure{HtmlPar}
{\EndP\Tg<p>}
{\EndP\Tg<p>}
{\HCode{</p>\Hnewline}}
{\HCode{</p>\Hnewline}}
\begin{document}
\DeclareGraphicsExtensions{.pdf,.eps,.png,.jpg,.mp,.mps}
\Css{
body {
margin: 0 auto;
max-width: 800px;
background: \#ffffff;
font-family: "Helvetica Neue", Arial, Freesans, clean, sans-serif;
}
h2 {color: \#000000; text-align: right; font-size: 32pt;}
.chapterHead .titlemark {
font-size: 20pt;
}
a {
color: \#000066;
text-decoration: none;
}
a:hover {
color: \#0000ff;
}
img {
max-width: 800px;
}
.figure {
text-align: center;
}
div .caption {
text-align: center;
}
.author {
font-size: 14pt;
}
.lstlisting {
background: \#eeeeee;
margin-left: 20px;
margin-right: 20px;
padding: 5px;
font-family: "Lucida Console", Monaco, monospace;
}
.lstinline {
padding: 2px;
font-family: "Lucida Console", Monaco, monospace;
}
.notebox {
border: 1px solid \#999999;
border-radius: 10px;
background: \#bbbbbb;
padding: 10px;
margin: 10px;
}
.warningbox {
border: 1px solid \#999999;
border-radius: 10px;
background: \#ffbbbb;
padding: 10px;
margin: 10px;
}
.tipbox {
border: 1px solid \#999999;
border-radius: 10px;
background: \#bbffbb;
padding: 10px;
margin: 10px;
}
}
\EndPreamble
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment