Sierra Toolkit  Version of the Day
LinsysFunctions.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 #ifndef stk_linsys_LinsysFunctions_hpp
10 #define stk_linsys_LinsysFunctions_hpp
11 
12 #include <stk_linsys/LinearSystemInterface.hpp>
13 
14 #include <stk_mesh/base/Field.hpp>
15 #include <stk_mesh/base/Selector.hpp>
16 #include <stk_mesh/base/BulkData.hpp>
17 
18 #include <Teuchos_ParameterList.hpp>
19 
20 
21 namespace stk_classic {
22 namespace linsys {
23 
35 void add_connectivities(stk_classic::linsys::LinearSystemInterface& ls,
36  stk_classic::mesh::EntityRank from_type,
37  stk_classic::mesh::EntityRank to_connected_type,
38  const stk_classic::mesh::FieldBase& field,
39  const stk_classic::mesh::Selector& selector,
40  const stk_classic::mesh::BulkData& mesh_bulk);
41 
50 void dirichlet_bc(stk_classic::linsys::LinearSystemInterface& ls,
51  const stk_classic::mesh::BulkData& mesh,
52  const stk_classic::mesh::Part& bcpart,
53  stk_classic::mesh::EntityRank entity_rank,
54  const stk_classic::mesh::FieldBase& field,
55  unsigned field_component,
56  double prescribed_value);
57 
58 
74 int fei_solve(int & status, fei::LinearSystem &fei_ls, const Teuchos::ParameterList & params);
75 
78 double compute_residual_norm2(fei::LinearSystem& fei_ls, fei::Vector& r);
79 
85 void copy_vector_to_mesh( fei::Vector & vec,
86  const DofMapper & dof,
87  stk_classic::mesh::BulkData & mesh_bulk_data
88  );
89 
92 void scale_matrix(double scalar, fei::Matrix& matrix);
93 
96 void add_matrix_to_matrix(double scalar,
97  const fei::Matrix& src_matrix,
98  fei::Matrix& dest_matrix);
99 
102 void scale_vector(double scalar,
103  fei::Vector& vec);
104 
107 void add_vector_to_vector(double scalar,
108  const fei::Vector& src_vector,
109  fei::Vector& dest_vector);
110 
111 }//namespace linsys
112 }//namespace stk_classic
113 
114 #endif
115 
void scale_vector(double scalar, fei::Vector &vec)
void add_connectivities(stk_classic::linsys::LinearSystemInterface &ls, stk_classic::mesh::EntityRank entity_rank, stk_classic::mesh::EntityRank connected_entity_rank, const stk_classic::mesh::FieldBase &field, const stk_classic::mesh::Selector &selector, const stk_classic::mesh::BulkData &mesh_bulk)
int fei_solve(int &status, fei::LinearSystem &fei_ls, const Teuchos::ParameterList &params)
Field base class with an anonymous data type and anonymous multi-dimension.
Definition: FieldBase.hpp:53
double compute_residual_norm2(fei::LinearSystem &fei_ls, fei::Vector &r)
This is a class for selecting buckets based on a set of meshparts and set logic.
Definition: Selector.hpp:112
An application-defined subset of a problem domain.
Definition: Part.hpp:49
void dirichlet_bc(stk_classic::linsys::LinearSystemInterface &ls, const stk_classic::mesh::BulkData &mesh, const stk_classic::mesh::Part &bcpart, stk_classic::mesh::EntityRank entity_rank, const stk_classic::mesh::FieldBase &field, unsigned field_component, double prescribed_value)
void copy_vector_to_mesh(fei::Vector &vec, const DofMapper &dof, stk_classic::mesh::BulkData &mesh_bulk_data)
Manager for an integrated collection of entities, entity relations, and buckets of field data...
Definition: BulkData.hpp:49
void add_matrix_to_matrix(double scalar, const fei::Matrix &src_matrix, fei::Matrix &dest_matrix)
Sierra Toolkit.
void add_vector_to_vector(double scalar, const fei::Vector &src_vector, fei::Vector &dest_vector)
void scale_matrix(double scalar, fei::Matrix &matrix)
EntityRank entity_rank(const EntityKey &key)
Given an entity key, return an entity type (rank).