MFEM
v3.1
Finite element discretization library
Main Page
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
linalg
operator.cpp
Go to the documentation of this file.
1
// Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2
// the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3
// reserved. See file COPYRIGHT for details.
4
//
5
// This file is part of the MFEM library. For more information and source code
6
// availability see http://mfem.org.
7
//
8
// MFEM is free software; you can redistribute it and/or modify it under the
9
// terms of the GNU Lesser General Public License (as published by the Free
10
// Software Foundation) version 2.1 dated February 1999.
11
12
#include <iostream>
13
#include <iomanip>
14
15
#include "
vector.hpp
"
16
#include "
operator.hpp
"
17
18
namespace
mfem
19
{
20
21
void
Operator::PrintMatlab
(std::ostream & out,
int
n,
int
m)
22
{
23
using namespace
std;
24
if
(n == 0) { n =
width
; }
25
if
(m == 0) { m =
height
; }
26
27
Vector
x(n), y(m);
28
x = 0.0;
29
30
int
i, j;
31
out << setiosflags(ios::scientific | ios::showpos);
32
for
(i = 0; i < n; i++)
33
{
34
if
(i != 0)
35
{
36
x(i-1) = 0.0;
37
}
38
x(i) = 1.0;
39
Mult
(x,y);
40
for
(j = 0; j < m; j++)
41
if
(y(j))
42
{
43
out << j+1 <<
" "
<< i+1 <<
" "
<< y(j) <<
'\n'
;
44
}
45
}
46
}
47
48
}
mfem::Operator::Mult
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application.
operator.hpp
mfem::Operator::PrintMatlab
void PrintMatlab(std::ostream &out, int n=0, int m=0)
Prints operator with input size n and output size m in matlab format.
Definition:
operator.cpp:21
mfem::Operator::height
int height
Definition:
operator.hpp:24
vector.hpp
mfem::Vector
Vector data type.
Definition:
vector.hpp:33
mfem::Operator::width
int width
Definition:
operator.hpp:24
Generated on Fri Feb 18 2022 18:59:18 for MFEM by
1.8.5