~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/Sundance/src-core/FrameworkInterface/SundanceFunctionIdentifier.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_FUNCTIONIDENTIFIER_H
 
32
#define SUNDANCE_FUNCTIONIDENTIFIER_H
 
33
 
 
34
#include "SundanceAlgebraSpecifier.hpp"
 
35
 
 
36
namespace SundanceCore
 
37
{
 
38
 
 
39
/** 
 
40
 * FunctionIdentifier provides a means for distinguishing between different
 
41
 * functions and different vector components of the same function. 
 
42
 * Functions discretized with vector bases will shared a common dofID,
 
43
 * because their vector components are not independent. Functions 
 
44
 * discretized componentwise will have different IDs for each component.
 
45
 */
 
46
class FunctionIdentifier
 
47
{
 
48
public:
 
49
  /** */
 
50
  FunctionIdentifier();
 
51
  /** ctor */
 
52
  FunctionIdentifier(const AlgebraSpecifier& algSpec);
 
53
  /** ctor */
 
54
  FunctionIdentifier(const FunctionIdentifier* parent,
 
55
    const AlgebraSpecifier& componentAlgSpec);
 
56
 
 
57
  /** */
 
58
  std::string toString() const ;
 
59
 
 
60
  /** Return the ID number to be used when assigning DOFs 
 
61
      for this function */
 
62
  int dofID() const {return dofID_;}
 
63
 
 
64
  /** If this FID corresponds to a vector component, return the 
 
65
   *  index of the coordinate direction */
 
66
  int componentIndex() const ;
 
67
 
 
68
  /** Return a specification of the type of object represented, i.e.,
 
69
   * a component in a coord direction, a normal component, or a whole
 
70
   * vector. */
 
71
  const AlgebraSpecifier& algSpec() const 
 
72
    {return algSpec_;}
 
73
 
 
74
  /** Create a new FID representing a component of "this" vector function. */
 
75
  FunctionIdentifier createComponent(int index) const ;
 
76
 
 
77
  /** Create a new FID representing the normal 
 
78
   * component of "this" vector function. */
 
79
  FunctionIdentifier createNormal() const ;
 
80
 
 
81
  /** Comparison operator for storage in sets and maps */
 
82
  bool operator<(const FunctionIdentifier& other) const ;
 
83
 
 
84
  /** Equality test */
 
85
  bool operator==(const FunctionIdentifier& other) const 
 
86
    {return !(*this!=other);} 
 
87
 
 
88
  /** Inequality test */
 
89
  bool operator!=(const FunctionIdentifier& other) const 
 
90
    {return *this < other || other < *this;}
 
91
 
 
92
  /** Return true if I am a vector */
 
93
  bool isVector() const {return algSpec().isVector();}
 
94
 
 
95
  /** Return true if I am a coordinate component */
 
96
  bool isCoordinateComponent() const {return algSpec().isCoordinateComponent();}
 
97
 
 
98
  /** Return true if I am a normal component */
 
99
  bool isNormalComponent() const {return algSpec().isNormal();}
 
100
 
 
101
  /** Return true if I am a scalar */
 
102
  bool isScalar() const {return algSpec().isScalar();}
 
103
 
 
104
private:
 
105
 
 
106
  /** Generate a unique ID */
 
107
  static int nextID() {static int id=0; id++; return id;}
 
108
 
 
109
  int dofID_;
 
110
 
 
111
  AlgebraSpecifier algSpec_;
 
112
};
 
113
 
 
114
/** \relates FunctionIdentifier */
 
115
FunctionIdentifier makeFuncID(int tensorOrder);
 
116
 
 
117
}
 
118
 
 
119
 
 
120
namespace std
 
121
{
 
122
/** \relates FunctionIdentifier */
 
123
ostream& operator<<(ostream& os, const SundanceCore::FunctionIdentifier& fid);
 
124
}
 
125
 
 
126
#endif