Skip to content

Commit

Permalink
small tweaks to simplify�[H
Browse files Browse the repository at this point in the history
  • Loading branch information
William Tobin committed Mar 7, 2018
1 parent fabc98d commit 7aa0cd0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(SOURCES
set(HEADERS
api/msi.h
api/msi_types.h
api/msi.f90
)

# include/msi_las.h
Expand Down
4 changes: 2 additions & 2 deletions api/msi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include <cmath> // isnan
msi::LasOps * ops = NULL;
//void set_adj_node_tag(pMesh m, pOwnership, pMeshTag num_global_adj_node_tag, pMeshTag num_own_adj_node_tag);
void msi_start(msi_msh * )
void msi_start()
{
#ifdef MSI_PETSC
ops = msi::getPetscOps();
#endif
}
void msi_finalize(msi_msh *)
void msi_finalize()
{ }
int msi_mesh_dim(msi_msh * msh)
{
Expand Down
21 changes: 15 additions & 6 deletions api/msi.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@
#define MSI_HEADER_H
#include "msi_types.h"
// enums used in the API
#ifdef __cplusplus
extern "C" {
#endif
enum msi_fld_tp { MSI_SUPPORT_FIELD = 0, MSI_SOLUTION_FIELD = 1, MSI_FIELD_TYPES = 2 };
enum msi_num_tp { MSI_DOF_NUMBERING = 0, MSI_NODE_NUMBERING = 1, MSI_NUM_TYPES = 2 };
void msi_start(msi_msh * msh);
void msi_finalize(msi_msh * msh);
void msi_start();
void msi_finalize();
// mesh api
int msi_mesh_dim(msi_msh * msh);
int msi_count_local_ents(msi_msh * msh, int dm);
msi_ent * msi_get_local_ent(msi_msh * msh, int dm, int idx);
int msi_get_ent_id(msi_msh * msh, msi_ent * ent);
void msi_get_adjacent(msi_msh * msh, msi_ent * ent, int adj_dim, msi_ent ** adj);
void msi_get_geom_class(msi_msh * msh, msi_ent * ent, int * mdl_dim, int * mdl_id);
// field api
msi_fld * msi_create_field(msi_msh * msh, const char * nm, int cmps, int ord);
void msi_destroy_field(msi_fld * fld);
msi_num * msi_number_field(msi_fld * fld, msi_num_tp tp);
int msi_count_components(msi_fld * fld);
// x = ax .+ b (element-wise)
// x = ax .+ b (per-dof)
void msi_field_axpb(MSI_SCALAR a, msi_fld * x, MSI_SCALAR b);
// y = ax + y (y != y)
void msi_field_axpy(MSI_SCALAR a, msi_fld * x, msi_fld * y);
Expand All @@ -37,14 +43,14 @@ void msi_node_dof_range(msi_fld * fld, msi_ent * ent, int nd, int * frst, int *
void msi_set_node_vals(msi_fld * fld, msi_ent * ent, int nd, MSI_SCALAR * dofs);
void msi_get_node_vals(msi_fld * fld, msi_ent * ent, int nd, MSI_SCALAR * dofs);
void msi_local_node_range(msi_fld * num, int * frst, int * lst_p1);
void msi_local_node_count(msi_fld * num, int * cnt);
int msi_local_node_count(msi_fld * num);
void msi_global_node_range(msi_fld * num, int * frst, int * lst_p1);
void msi_global_node_count(msi_fld * num, int * cnt);
// dof api
void msi_local_dof_range(msi_num * num, int * frst, int * lst_p1);
void msi_local_dof_count(msi_num * num, int * cnt);
int msi_local_dof_count(msi_num * num);
void msi_global_dof_range(msi_num * num, int * frst, int * lst_p1);
void msi_global_dof_count(msi_num * num, int * cnt);
int msi_global_dof_count(msi_num * num);
// las api
msi_mat * msi_create_matrix(msi_num * num);
msi_vec * msi_create_vector(msi_num * num);
Expand All @@ -69,5 +75,8 @@ void msi_vec_as_field_storage(msi_vec * vec, msi_fld * fld);
void msi_vec_array_field_storage(msi_vec * vec, msi_num * num, msi_fld * fld);
void msi_vec_array_field_activate_vec(msi_fld * fld);
void msi_vec_array_field_activate_field(msi_fld * fld);
#ifdef __cplusplus
}
#endif
#endif

7 changes: 6 additions & 1 deletion api/msi_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*******************************************************************************/
#ifndef MSI_TYPES_H_
#define MSI_TYPES_H_
#include "msi_las.h"
//#include "msi_las.h"
#include <apf.h>
#include <apfMesh2.h>
#include <apfNumbering.h>
Expand All @@ -22,6 +22,11 @@ typedef apf::MeshEntity msi_ent;
typedef apf::Field msi_fld;
typedef apf::FieldShape msi_shp;
typedef apf::Numbering msi_num;
namespace msi
{
class Mat;
class Vec;
}
typedef msi::Mat msi_mat;
typedef msi::Vec msi_vec;
#endif

0 comments on commit 7aa0cd0

Please sign in to comment.