~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/Sundance/src-core/FrameworkInterface/SundanceAlgebraSpecifier.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @HEADER@ */
 
2
// ************************************************************************
 
3
// 
 
4
//                              Sundance
 
5
//                 Copyright (2005) Sandia Corporation
 
6
// 
 
7
// Copyright (year first published) Sandia Corporation.  Under the terms 
 
8
// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 
 
9
// retains certain rights in this software.
 
10
// 
 
11
// This library is free software; you can redistribute it and/or modify
 
12
// it under the terms of the GNU Lesser General Public License as
 
13
// published by the Free Software Foundation; either version 2.1 of the
 
14
// License, or (at your option) any later version.
 
15
//  
 
16
// This library is distributed in the hope that it will be useful, but
 
17
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
19
// Lesser General Public License for more details.
 
20
//                                                                                 
 
21
// You should have received a copy of the GNU Lesser General Public
 
22
// License along with this library; if not, write to the Free Software
 
23
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
24
// USA                                                                                
 
25
// Questions? Contact Kevin Long (krlong@sandia.gov), 
 
26
// Sandia National Laboratories, Livermore, California, USA
 
27
// 
 
28
// ************************************************************************
 
29
/* @HEADER@ */
 
30
 
 
31
#ifndef SUNDANCE_ALGEBRASPECIFIER_HPP
 
32
#define SUNDANCE_ALGEBRASPECIFIER_HPP
 
33
 
 
34
#include "SundanceEnumTypeField.hpp"
 
35
 
 
36
namespace SundanceCore
 
37
{
 
38
using namespace SundanceUtils;
 
39
 
 
40
/** */
 
41
enum AlgebraType {VectorAT, NormalAT, CoordCompAT, ScalarAT};
 
42
 
 
43
/** AlgebraSpecifier is used to indicate whether a given object represents
 
44
 * a vector, scalar, component of a vector, etc. 
 
45
 */
 
46
class AlgebraSpecifier : public EnumTypeField<AlgebraType>
 
47
{
 
48
public:
 
49
  /** */
 
50
  AlgebraSpecifier();
 
51
 
 
52
  /** */
 
53
  AlgebraSpecifier(int direction);
 
54
 
 
55
  /** */
 
56
  AlgebraSpecifier(const AlgebraType& vct);
 
57
 
 
58
  /** Return true iff I am a scalar */
 
59
  bool isScalar() const {return isType(ScalarAT);}
 
60
 
 
61
  /** Return true iff I am a normal component of a vector */
 
62
  bool isNormal() const {return isType(NormalAT);}
 
63
 
 
64
  /** Return true iff I am a vector */
 
65
  bool isVector() const {return isType(VectorAT);}
 
66
 
 
67
  /** Return true iff I am a coordinate component of a vector */
 
68
  bool isCoordinateComponent() const {return isType(CoordCompAT);}
 
69
 
 
70
  /** Return coordinate direction if I am a coordinate component, 
 
71
   * otherwise, throw an exception. */
 
72
  int direction() const ;
 
73
 
 
74
  /** Write a string representation */
 
75
  std::string toString() const ;
 
76
 
 
77
  /** Comparison operator for use in sorted containers */
 
78
  bool operator<(const AlgebraSpecifier& other) const ;
 
79
 
 
80
private:
 
81
  int direction_;
 
82
};
 
83
 
 
84
/** \relates AlgebraSpecifier */
 
85
AlgebraSpecifier vectorAlgebraSpec();
 
86
 
 
87
/** \relates AlgebraSpecifier */
 
88
AlgebraSpecifier scalarAlgebraSpec();
 
89
 
 
90
/** \relates AlgebraSpecifier */
 
91
AlgebraSpecifier normalAlgebraSpec();
 
92
 
 
93
/** \relates AlgebraSpecifier */
 
94
AlgebraSpecifier coordAlgebraSpec(int dir);
 
95
 
 
96
}
 
97
 
 
98
 
 
99
namespace std
 
100
{
 
101
/** \relates AlgebraSpecifier */
 
102
ostream& operator<<(ostream& os, const SundanceCore::AlgebraSpecifier& vcs);
 
103
/** \relates AlgebraSpecifier */
 
104
ostream& operator<<(ostream& os, const SundanceCore::AlgebraType& vct);
 
105
}
 
106
 
 
107
 
 
108
#endif