Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update types in Tribol #76

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/examples/common_plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#include "tribol/physics/CommonPlane.hpp"
#include "tribol/geom/GeomUtilities.hpp"

#ifdef TRIBOL_USE_UMPIRE
// Umpire includes
#include "umpire/ResourceManager.hpp"
#endif

#include "axom/slic.hpp"

// C/C++ includes
Expand Down Expand Up @@ -57,9 +62,13 @@ int main( int argc, char** argv )
#ifdef TRIBOL_USE_MPI
MPI_Init( &argc, &argv );
#endif
tribol::CommType problem_comm = TRIBOL_COMM_WORLD;
tribol::CommT problem_comm = TRIBOL_COMM_WORLD;
initialize_logger( problem_comm );

#ifdef TRIBOL_USE_UMPIRE
umpire::ResourceManager::getInstance(); // initialize umpire's ResouceManager
#endif

// parse command line arguments
Arguments args;
{
Expand Down
18 changes: 9 additions & 9 deletions src/examples/examples_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace utilities = axom::utilities;
namespace fmt = axom::fmt;
namespace CLI = axom::CLI;

using real = tribol::real;
using RealT = tribol::RealT;

//------------------------------------------------------------------------------
// COMMON DATA STRUCTURE DEFINITIONS
Expand Down Expand Up @@ -101,12 +101,12 @@ struct Arguments
bool dump_vis{false}; // should the example dump visualization files?

/// input arguments for examples that use the TestMesh class
std::vector<tribol::integer> block1_res{4, 4, 4}; // block1 -- number of elements in each direction
std::vector<tribol::real> block1_min {0., 0., 0.}; // block1 -- bounding box min
std::vector<tribol::real> block1_max {1., 1., 1.05}; // block1 -- bounding box max
std::vector<tribol::integer> block2_res{4, 4, 4}; // block2 -- number of elements in each direction
std::vector<tribol::real> block2_min {0., 0., 0.95}; // block2 -- bounding box min
std::vector<tribol::real> block2_max {1., 1., 2.}; // block2 -- bounding box max
std::vector<int> block1_res{4, 4, 4}; // block1 -- number of elements in each direction
std::vector<tribol::RealT> block1_min {0., 0., 0.}; // block1 -- bounding box min
std::vector<tribol::RealT> block1_max {1., 1., 1.05}; // block1 -- bounding box max
std::vector<int> block2_res{4, 4, 4}; // block2 -- number of elements in each direction
std::vector<tribol::RealT> block2_min {0., 0., 0.95}; // block2 -- bounding box min
std::vector<tribol::RealT> block2_max {1., 1., 2.}; // block2 -- bounding box max
};

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -233,7 +233,7 @@ int tribol_register_and_update( tribol::TestMesh &mesh,
// STEP 0: initialize tribol //
// //
///////////////////////////////
tribol::CommType problem_comm = TRIBOL_COMM_WORLD;
tribol::CommT problem_comm = TRIBOL_COMM_WORLD;
tribol::initialize( mesh.dim, problem_comm );

/////////////////////////////////////////////
Expand Down Expand Up @@ -504,7 +504,7 @@ int tribol_register_and_update( tribol::TestMesh &mesh,
* \brief Initialize logger
* \param [in] problem_comm MPI communicator
*/
void initialize_logger( tribol::CommType problem_comm )
void initialize_logger( tribol::CommT problem_comm )
{
slic::initialize();
slic::setLoggingMsgLevel( slic::message::Debug );
Expand Down
12 changes: 6 additions & 6 deletions src/examples/mortar_lm_patch_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int main( int argc, char** argv )
#ifdef TRIBOL_USE_MPI
MPI_Init( &argc, &argv );
#endif
tribol::CommType problem_comm = TRIBOL_COMM_WORLD;
tribol::CommT problem_comm = TRIBOL_COMM_WORLD;

#ifdef TRIBOL_USE_UMPIRE
umpire::ResourceManager::getInstance(); // initialize umpire's ResouceManager
Expand Down Expand Up @@ -184,8 +184,8 @@ int main( int argc, char** argv )
////////////////////////////////////////////////////

// setup material properties
double nu_val {0.33}; // Poisson's ratio
double youngs_val {3.E7}; // Young's modulus (approximate, mild steel (psi))
RealT nu_val {0.33}; // Poisson's ratio
RealT youngs_val {3.E7}; // Young's modulus (approximate, mild steel (psi))

/////////////////////////////////////////////////////////////////////////
// compute equilibrium contributions and sum into Tribol sparse matrix //
Expand All @@ -205,7 +205,7 @@ int main( int argc, char** argv )
// instantiate mfem vector for RHS contributions
int rhs_size = mesh.dim * mesh.numTotalNodes + // equilibrium equations
mesh.numNonmortarSurfaceNodes; // gap equations
double b[ rhs_size ];
RealT b[ rhs_size ];
tribol::initRealArray( &b[0], rhs_size, 0. );
mfem::Vector rhs( &b[0], rhs_size );
rhs = 0.; // initialize
Expand Down Expand Up @@ -263,11 +263,11 @@ int main( int argc, char** argv )
mfem::DenseMatrixInverse invA( A );
mfem::Vector sol;
invA.Mult( rhs, sol ); // solve the system
real * sol_data = sol.GetData(); // get solution data
RealT * sol_data = sol.GetData(); // get solution data

SLIC_INFO( "Solved global system of equations." );

real pressureSum = 0.;
RealT pressureSum = 0.;
for (int i=0; i<mesh.numNonmortarSurfaceNodes; ++i)
{
int offset = mesh.dim * mesh.numTotalNodes;
Expand Down
Loading