~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/kernel/io/XMLDofMap.cpp

  • Committer: Johannes Ring
  • Date: 2008-03-05 22:43:06 UTC
  • Revision ID: johannr@simula.no-20080305224306-2npsdyhfdpl2esji
The BIG commit!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2007 Anders Logg.
2
 
// Licensed under the GNU LGPL Version 2.1.
3
 
//
4
 
// First added:  2007-04-13
5
 
// Last changed: 2007-04-13
6
 
 
7
 
#include <dolfin/dolfin_log.h>
8
 
#include <dolfin/XMLDofMap.h>
9
 
 
10
 
using namespace dolfin;
11
 
 
12
 
//-----------------------------------------------------------------------------
13
 
XMLDofMap::XMLDofMap(std::string& signature)
14
 
  : XMLObject(), signature(signature)
15
 
{
16
 
  state = OUTSIDE;
17
 
}
18
 
//-----------------------------------------------------------------------------
19
 
void XMLDofMap::startElement(const xmlChar* name, const xmlChar** attrs)
20
 
{
21
 
  switch ( state )
22
 
  {
23
 
  case OUTSIDE:
24
 
    
25
 
    if ( xmlStrcasecmp(name, (xmlChar *) "dofmap") == 0 )
26
 
    {
27
 
      readDofMap(name, attrs);
28
 
      state = INSIDE_DOF_MAP;
29
 
    }
30
 
    
31
 
    break;
32
 
    
33
 
  default:
34
 
    ;
35
 
  }
36
 
}
37
 
//-----------------------------------------------------------------------------
38
 
void XMLDofMap::endElement(const xmlChar* name)
39
 
{
40
 
  switch ( state )
41
 
  {
42
 
  case INSIDE_DOF_MAP:
43
 
    
44
 
    if ( xmlStrcasecmp(name, (xmlChar *) "dofmap") == 0 )
45
 
    {
46
 
      state = DONE;
47
 
    }
48
 
    
49
 
    break;
50
 
    
51
 
  default:
52
 
    ;
53
 
  }
54
 
}
55
 
//-----------------------------------------------------------------------------
56
 
void XMLDofMap::readDofMap(const xmlChar* name,
57
 
                                         const xmlChar** attrs)
58
 
{
59
 
  // Parse values
60
 
  signature = parseString(name, attrs, "signature");
61
 
}
62
 
//-----------------------------------------------------------------------------