5 #include "Epetra_ConfigDefs.h"     8 #include "Epetra_MpiComm.h"    10 #include "Epetra_SerialComm.h"    13 #include "Teuchos_CommandLineProcessor.hpp"    14 #include "Teuchos_StandardCatchMacros.hpp"    15 #include "Teuchos_ParameterList.hpp"    16 #include "Teuchos_XMLParameterListCoreHelpers.hpp"    19 int main(
int argc, 
char *argv[]){
    21     std::string    xmlInFileName = 
"";
    22     std::string    extraXmlFile = 
"";
    23     std::string    xmlOutFileName = 
"paramList.out";
    25     Teuchos::CommandLineProcessor  clp(
false);
    26     clp.setOption(
"xml-in-file",&xmlInFileName,
"The XML file to read into a parameter list");
    27     clp.setDocString(
"TO DO.");
    29     Teuchos::CommandLineProcessor::EParseCommandLineReturn
    30     parse_return = clp.parse(argc,argv);
    31     if( parse_return != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL ) {
    32         std::cout << 
"\nEnd Result: TEST FAILED" << std::endl;
    37     MPI_Init(&argc, &argv);
    38     Epetra_MpiComm Comm(MPI_COMM_WORLD);
    40     Epetra_SerialComm Comm;
    43     Teuchos::RCP<Teuchos::ParameterList> paramList = Teuchos::rcp(
new Teuchos::ParameterList);
    44     if(xmlInFileName.length()) {
    45         Teuchos::updateParametersFromXmlFile(xmlInFileName, inoutArg(*paramList));
    47             paramList->print(std::cout,2,
true,
true);
    51     std::string mesh_file = Teuchos::getParameter<std::string>(paramList->sublist(
"Shinozuka"),
"mesh_file");
    52     mesh Mesh(Comm,mesh_file,1.0);
    53     Epetra_Map StandardMap(-1,Mesh.n_local_nodes_without_ghosts,&Mesh.local_nodes_without_ghosts[0],0,Comm);
    55     int order = Teuchos::getParameter<int>(paramList->sublist(
"Shinozuka"), 
"order");
    56     double l1 = Teuchos::getParameter<double>(paramList->sublist(
"Shinozuka"), 
"lx");
    57     double l2 = Teuchos::getParameter<double>(paramList->sublist(
"Shinozuka"), 
"ly");
    58     double pa = 2.0*M_PI*60.0/360.0;
    60     Epetra_MultiVector V(StandardMap,5,
"true");
    62     for (
int i=0; 
i<5; ++
i){
    63       Teuchos::RCP<shinozuka_2d> RandomField = Teuchos::rcp(
new shinozuka_2d(order,l1,l2));
    64       RandomField->rotation = pa;
    67       RandomField->rng.seed(
i);
    68       RandomField->generator(*V(
i),Mesh);
    71     std::string path = 
"/home/s/staber/Trilinos_results/nrl/shinozuka_2d/";
    72     int NumTargetElements = 0;
    74         NumTargetElements = Mesh.n_nodes;
    76     Epetra_Map MapOnRoot(-1,NumTargetElements,0,Comm);
    77     Epetra_Export ExportOnRoot(StandardMap,MapOnRoot);
    78     Epetra_MultiVector lhs_root(MapOnRoot,5,
true);
    80     lhs_root.PutScalar(0.0);
    81     lhs_root.Export(V,ExportOnRoot,Insert);
    82     std::string 
filename = path + 
"gaussian_fields_for_eng_constants.mtx";
    83     int error = EpetraExt::MultiVectorToMatrixMarketFile(filename.c_str(),lhs_root,0,0,
false);
 
int main(int argc, char *argv[])