#include "moab/Core.hpp"
#include "moab/ScdInterface.hpp"
#include "moab/ProgOptions.hpp"
#include "moab/CN.hpp"
#include <iostream>
#include <vector>
Go to the source code of this file.
|
#define | MYSTREAM(a) if( !rank ) cout << a << endl |
|
|
int | main (int argc, char **argv) |
|
◆ MYSTREAM
#define MYSTREAM |
( |
|
a | ) |
if( !rank ) cout << a << endl |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
- Examples
- StructuredMeshSimple.cpp.
Definition at line 39 of file StructuredMeshSimple.cpp.
44 MPI_Init( &argc, &argv );
48 opts.
addOpt<
int >( string(
"dim,d" ), string(
"Dimension of mesh (default=3)" ), &
dim );
49 opts.
addOpt<
int >( string(
",n" ), string(
"Number of elements on a side (default=10)" ), &N );
54 if( NULL ==
mb )
return 1;
60 int rank = 0, nprocs = 1;
61 MPI_Comm_size( MPI_COMM_WORLD, &nprocs );
62 MPI_Comm_rank( MPI_COMM_WORLD, &rank );
63 int ilow = rank * N, ihigh = ilow + N;
66 int ilow = 0, ihigh = N;
73 (
dim > 2 ? 0 : -1 ) ),
74 HomCoord( ihigh, (
dim > 1 ? N : -1 ), (
dim > 2 ? N : -1 ) ), NULL,
86 #define MYSTREAM( a ) \
87 if( !rank ) cout << a << endl
89 if( pow( N,
dim ) == (
int)elems.
size() && pow( N + 1,
dim ) == (
int)verts.
size() )
95 <<
" elements and " << verts.
size() <<
" vertices." << endl );
98 cout <<
"Created the wrong number of vertices or hexes!" << endl;
101 vector< double > coords( 3 * pow( N + 1,
dim ) );
102 vector< EntityHandle > connect;
103 for(
int k = 0; k < (
dim > 2 ? N : 1 ); k++ )
105 for(
int j = 0; j < (
dim > 1 ? N : 1 ); j++ )
107 for(
int i = 0; i < N - 1; i++ )
111 if( 0 == ehandle )
return MB_FAILURE;
References ProgOptions::addOpt(), moab::Range::begin(), moab::ScdInterface::construct_box(), dim, moab::CN::EntityTypeName(), ErrorCode, moab::Core::get_connectivity(), moab::Core::get_coords(), moab::ScdBox::get_element(), moab::Core::get_entities_by_dimension(), mb, MB_CHK_ERR, MYSTREAM, ProgOptions::parseCommandLine(), moab::Interface::query_interface(), moab::Interface::release_interface(), moab::Range::size(), and moab::Core::type_from_handle().