SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BuildFEGridMapping.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2009 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 #ifndef CORE_ALGORITHMS_FINTEELEMENTS_BUILDFEGRIDMAPPING_H
30 #define CORE_ALGORITHMS_FINTEELEMENTS_BUILDFEGRIDMAPPING_H 1
31 
32 // Datatypes that the algorithm uses
33 #include <Core/Datatypes/Mesh.h>
34 #include <Core/Datatypes/Field.h>
35 #include <Core/Datatypes/Matrix.h>
36 #include <Core/Datatypes/MatrixOperations.h>
37 
38 // Base class for algorithm
39 #include <Core/Algorithms/Util/AlgoBase.h>
40 
41 // for Windows support
42 #include <Core/Algorithms/FiniteElements/share.h>
43 
44 namespace SCIRunAlgo {
45 
46 using namespace SCIRun;
47 
48 // Generate mapping matrices for the case that certain nodes contain the same
49 // value, e.g. a period domain or a domain with a floating conductor.
50 // This function will generate a mapping from the mesh (geom) to the computational
51 // grid (grid). Depending on which vector with values need to be adapted
52 // (sources or potentials) several mapping matrices are constructed.
53 
54 class SCISHARE BuildFEGridMappingAlgo : public AlgoBase
55 {
56  public:
57  // Set default values
59  {
60  add_bool("build_potential_gridtogeom",true);
61  add_bool("build_potential_geomtogrid",true);
62  add_bool("build_current_gridtogeom",true);
63  add_bool("build_current_geomtogrid",true);
64  }
65 
66  // Griduting the mapping between the Gridutational Grid and the
67  // Geometry grid: We have two versions, one for potentials where potentials
68  // are averaged when projected onto the grid and where they are copied when
69  // projecting back on the mesh, and one for currents, where currents are
70  // added together when nodes are merged and where currents are distributed
71  // over the nodes when translating back to the geometry.
72  // More over potentials are assumed to be continuous over the boundary
73  // and currents are assumed as sources that need to be divided or added
74  // together.
75  bool run(MatrixHandle& NodeLink,
76  MatrixHandle& PotentialGeomToGrid,
77  MatrixHandle& PotentialGridToGeom,
78  MatrixHandle& CurrentGeomToGrid,
79  MatrixHandle& CurrentGridToGeom);
80 
81  // Special version for not linking elements that
82  // are not in the same domain
83  bool run(FieldHandle& DomainField,
84  MatrixHandle& NodeLink,
85  MatrixHandle& PotentialGeomToGrid,
86  MatrixHandle& PotentialGridToGeom,
87  MatrixHandle& CurrentGeomToGrid,
88  MatrixHandle& CurrentGridToGeom);
89 };
90 
91 }
92 
93 #endif
LockingHandle< Matrix< double > > MatrixHandle
Definition: MatrixFwd.h:55
BuildFEGridMappingAlgo()
Definition: BuildFEGridMapping.h:58
#define SCISHARE
Definition: share.h:39
Definition: BuildFEGridMapping.h:54
boost::shared_ptr< Field > FieldHandle
Definition: DatatypeFwd.h:65