47 #ifndef MFEM_USE_SUPERLU
48 #error This example requires that MFEM is built with MFEM_USE_SUPERLU=YES
54 int main(
int argc,
char *argv[])
58 MPI_Init(&argc, &argv);
59 MPI_Comm_size(MPI_COMM_WORLD, &num_procs);
60 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
63 const char *mesh_file =
"../../data/star.mesh";
65 const char *device_config =
"cpu";
66 bool visualization =
true;
72 args.
AddOption(&mesh_file,
"-m",
"--mesh",
75 "Finite element order (polynomial degree) or -1 for"
76 " isoparametric space.");
77 args.
AddOption(&device_config,
"-d",
"--device",
78 "Device configuration string, see Device::Configure().");
79 args.
AddOption(&visualization,
"-vis",
"--visualization",
"-no-vis",
81 "Enable or disable GLVis visualization.");
82 args.
AddOption(&slu_colperm,
"-cp",
"--colperm",
83 "SuperLU Column Permutation Method: 0-NATURAL, 1-MMD-ATA "
84 "2-MMD_AT_PLUS_A, 3-COLAMD, 4-METIS_AT_PLUS_A, 5-PARMETIS "
86 args.
AddOption(&slu_rowperm,
"-rp",
"--rowperm",
87 "SuperLU Row Permutation Method: 0-NOROWPERM, 1-LargeDiag");
88 args.
AddOption(&slu_iterref,
"-rp",
"--rowperm",
89 "SuperLU Iterative Refinement: 0-NOREFINE, 1-Single, "
109 Device device(device_config);
110 if (myid == 0) { device.
Print(); }
115 Mesh mesh(mesh_file, 1, 1);
124 (int)floor(log(1000./mesh.
GetNE())/log(2.)/
dim);
125 for (
int l = 0; l < ref_levels; l++)
134 ParMesh pmesh(MPI_COMM_WORLD, mesh);
137 int par_ref_levels = 2;
138 for (
int l = 0; l < par_ref_levels; l++)
160 cout <<
"Using isoparametric FEs: " << fec->
Name() << endl;
172 cout <<
"Number of finite element unknowns: " << size << endl;
223 if (slu_colperm == 0)
227 else if (slu_colperm == 1)
231 else if (slu_colperm == 2)
235 else if (slu_colperm == 3)
239 else if (slu_colperm == 4)
243 else if (slu_colperm == 5)
247 else if (slu_colperm == 6)
252 if (slu_rowperm == 0)
256 else if (slu_rowperm == 1)
258 #ifdef MFEM_USE_SUPERLU5
265 if (slu_iterref == 0)
269 else if (slu_iterref == 1)
273 else if (slu_iterref == 2)
277 else if (slu_iterref == 3)
297 ostringstream mesh_name, sol_name;
298 mesh_name <<
"mesh." << setfill(
'0') << setw(6) << myid;
299 sol_name <<
"sol." << setfill(
'0') << setw(6) << myid;
301 ofstream mesh_ofs(mesh_name.str().c_str());
302 mesh_ofs.precision(8);
303 pmesh.
Print(mesh_ofs);
305 ofstream sol_ofs(sol_name.str().c_str());
306 sol_ofs.precision(8);
316 sol_sock <<
"parallel " << num_procs <<
" " << myid <<
"\n";
317 sol_sock.precision(8);
318 sol_sock <<
"solution\n" << pmesh << x << flush;
int Size() const
Return the logical size of the array.
Class for domain integration L(v) := (f, v)
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
OpType * As() const
Return the Operator pointer statically cast to a specified OpType. Similar to the method Get()...
void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
A coefficient that is constant across space and time.
Pointer to an Operator of a specified type.
HYPRE_BigInt GlobalTrueVSize() const
void SetRowPermutation(superlu::RowPerm row_perm, Array< int > *perm=NULL)
int GetNE() const
Returns number of elements.
virtual void Save(std::ostream &out) const
void Print(std::ostream &out=mfem::out)
Print the configuration of the MFEM virtual device object.
Abstract parallel finite element space.
void SetSymmetricPattern(bool sym)
void SetOperator(const Operator &op)
Set/update the solver for the given operator.
void SetIterativeRefine(superlu::IterRefine iter_ref)
void Parse()
Parse the command-line options. Note that this function expects all the options provided through the ...
void SetColumnPermutation(superlu::ColPerm col_perm)
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
virtual void Print(std::ostream &out=mfem::out) const
void SetPrintStatistics(bool print_stat)
void PrintUsage(std::ostream &out) const
Print the usage message.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
void AddOption(bool *var, const char *enable_short_name, const char *enable_long_name, const char *disable_short_name, const char *disable_long_name, const char *description, bool required=false)
Add a boolean option and set 'var' to receive the value. Enable/disable tags are used to set the bool...
virtual const char * Name() const
void PrintOptions(std::ostream &out) const
Print the options.
void Clear()
Clear the contents of the Mesh.
void GetNodes(Vector &node_coord) const
Arbitrary order H1-conforming (continuous) finite elements.
Class for parallel grid function.
The MFEM Device class abstracts hardware devices such as GPUs, as well as programming models such as ...
Wrapper for hypre's ParCSR matrix class.
Class for parallel meshes.
bool Good() const
Return true if the command line options were parsed successfully.