FEI Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
base
fei_Factory.cpp
Go to the documentation of this file.
1
/*--------------------------------------------------------------------*/
2
/* Copyright 2005 Sandia Corporation. */
3
/* Under the terms of Contract DE-AC04-94AL85000, there is a */
4
/* non-exclusive license for use of this work by or on behalf */
5
/* of the U.S. Government. Export of this program may require */
6
/* a license from the United States Government. */
7
/*--------------------------------------------------------------------*/
8
9
#include <
fei_macros.hpp
>
10
11
#include <
fei_Factory.hpp
>
12
#include <
fei_LogManager.hpp
>
13
#include <
fei_LogFile.hpp
>
14
#include <
fei_ParameterSet.hpp
>
15
16
#include <
FEI_Implementation.hpp
>
17
#include <
fei_FEI_Impl.hpp
>
18
19
//----------------------------------------------------------------------------
20
fei::Factory::Factory
(
MPI_Comm
comm)
21
{
22
int
numProcs
= 1,
localProc
= 0;
23
#ifndef FEI_SER
24
MPI_Comm_size(comm, &
numProcs
);
25
MPI_Comm_rank(comm, &
localProc
);
26
#endif
27
fei::LogManager::getLogManager
().
setNumProcs
(
numProcs
,
localProc
);
28
}
29
30
//----------------------------------------------------------------------------
31
fei::Factory::~Factory
()
32
{
33
fei::LogFile::getLogFile
().
closeOutputStream
();
34
fei::LogManager::getLogManager
().
setOutputLevel
(
fei::NONE
);
35
}
36
37
//----------------------------------------------------------------------------
38
void
fei::Factory::parameters
(
const
fei::ParameterSet
& paramset)
39
{
40
const
fei::Param
* param = paramset.
get
(
"FEI_OUTPUT_PATH"
);
41
fei::Param::ParamType
ptype = param != NULL ?
42
param->
getType
() :
fei::Param::BAD_TYPE
;
43
if
(ptype ==
fei::Param::STRING
) {
44
fei::LogManager
& log_manager =
fei::LogManager::getLogManager
();
45
log_manager.
setOutputPath
(param->
getStringValue
().c_str());
46
}
47
48
param = paramset.
get
(
"debugOutput"
);
49
ptype = param != NULL ? param->
getType
() :
fei::Param::BAD_TYPE
;
50
if
(ptype ==
fei::Param::STRING
) {
51
fei::LogManager
& log_manager =
fei::LogManager::getLogManager
();
52
log_manager.
setOutputPath
(param->
getStringValue
().c_str());
53
}
54
55
param = paramset.
get
(
"FEI_OUTPUT_LEVEL"
);
56
ptype = param != NULL ? param->
getType
() :
fei::Param::BAD_TYPE
;
57
if
(ptype ==
fei::Param::STRING
) {
58
fei::LogManager
& log_manager =
fei::LogManager::getLogManager
();
59
log_manager.
setOutputLevel
(param->
getStringValue
().c_str());
60
}
61
}
62
63
//----------------------------------------------------------------------------
64
fei::SharedPtr<FEI>
65
fei::Factory::createFEI
(
fei::SharedPtr<LibraryWrapper>
wrapper,
66
MPI_Comm
comm)
67
{
68
//fei::SharedPtr<FEI> fei(new fei::FEI_Impl(wrapper, comm));
69
fei::SharedPtr<FEI>
fei
(
new
FEI_Implementation
(wrapper, comm));
70
71
return
(
fei
);
72
}
73
74
//----------------------------------------------------------------------------
75
fei::SharedPtr<FEI>
76
fei::Factory::createFEI
(
MPI_Comm
comm)
77
{
78
fei::SharedPtr<FEI>
fei
(
new
fei::FEI_Impl
(
this
, comm));
79
80
return
(
fei
);
81
}
82
83
//----------------------------------------------------------------------------
84
FEI_Implementation.hpp
fei::FEI_Impl
Definition
fei_FEI_Impl.hpp:33
fei::Factory::createFEI
virtual fei::SharedPtr< FEI > createFEI(fei::SharedPtr< LibraryWrapper > wrapper, MPI_Comm comm)
Definition
fei_Factory.cpp:65
fei::Factory::Factory
Factory()
fei::Factory::~Factory
virtual ~Factory()
Definition
fei_Factory.cpp:31
fei::Factory::parameters
virtual void parameters(const fei::ParameterSet ¶mset)
Definition
fei_Factory.cpp:38
fei::LogFile::closeOutputStream
void closeOutputStream()
Definition
fei_LogFile.cpp:62
fei::LogFile::getLogFile
static LogFile & getLogFile()
Definition
fei_LogFile.cpp:68
fei::LogManager
Definition
fei_LogManager.hpp:22
fei::LogManager::setOutputLevel
void setOutputLevel(OutputLevel olevel)
Definition
fei_LogManager.cpp:35
fei::LogManager::getLogManager
static LogManager & getLogManager()
Definition
fei_LogManager.cpp:24
fei::LogManager::setOutputPath
void setOutputPath(const std::string &opath)
Definition
fei_LogManager.cpp:58
fei::LogManager::setNumProcs
void setNumProcs(int nprocs, int localproc)
Definition
fei_LogManager.cpp:68
fei::Param
Definition
fei_Param.hpp:23
fei::Param::getStringValue
const std::string & getStringValue() const
Definition
fei_Param.hpp:104
fei::Param::ParamType
ParamType
Definition
fei_Param.hpp:26
fei::Param::BAD_TYPE
@ BAD_TYPE
Definition
fei_Param.hpp:32
fei::Param::STRING
@ STRING
Definition
fei_Param.hpp:27
fei::Param::getType
ParamType getType() const
Definition
fei_Param.hpp:98
fei::ParameterSet
Definition
fei_ParameterSet.hpp:46
fei::ParameterSet::get
const Param * get(const char *name) const
Definition
fei_ParameterSet.hpp:260
fei::SharedPtr
Definition
fei_SharedPtr.hpp:65
fei_FEI_Impl.hpp
fei_Factory.hpp
fei_LogFile.hpp
fei_LogManager.hpp
fei_ParameterSet.hpp
fei_macros.hpp
MPI_Comm
#define MPI_Comm
Definition
fei_mpi.h:56
FEI_Implementation
#define FEI_Implementation
Definition
fei_version.h:66
fei
Definition
fei_ArrayUtils.hpp:16
fei::localProc
int localProc(MPI_Comm comm)
Definition
fei_CommUtils.cpp:13
fei::NONE
@ NONE
Definition
fei_fwd.hpp:87
fei::numProcs
int numProcs(MPI_Comm comm)
Definition
fei_CommUtils.cpp:25
Generated by
1.17.0