Compare commits

...
Author SHA1 Message Date
Sean Ingimarson 25633dab0a lor-transfer commit 2022-08-01 16:21:12 -07:00
Sean Ingimarson 4810864eb8 Replacing the old NodeShift with a nonloop function 2022-07-25 16:39:00 -07:00
Sean Ingimarson 1cb9a97410 Working subdivisions and improved NodeShift 2022-07-22 17:07:21 -07:00
Sean Ingimarson 1449274f0d Working code 2022-07-07 13:15:49 -07:00
Sean Ingimarson a6d34a24eb commenting finder out 2022-07-06 09:07:56 -07:00
Arturo Vargas d18a1879df increase integration rule 2022-07-05 18:01:17 -07:00
Arturo Vargas f47530045d fix basis function eval 2022-07-05 17:45:43 -07:00
Arturo Vargas 56bcc893a5 clean up pass 2022-07-05 14:19:51 -07:00
Arturo Vargas 6a4fef6234 revert changes to my last commit 2022-07-05 14:07:12 -07:00
Arturo Vargas 7f6fd0617d Merge branch 'ingimarson/lor-massavg' of github.com:mfem/mfem into ingimarson/lor-massavg 2022-07-05 14:04:29 -07:00
Arturo Vargas 1735e16078 force recalculation of integration rule at basis fun 2022-07-05 14:04:14 -07:00
Sean Ingimarson 6ff8b2a6cf test 2022-07-05 12:58:48 -07:00
Sean Ingimarson 7ec8f075bf small changes 2022-07-05 12:45:56 -07:00
Arturo Vargas c552842bb3 clean up pass 2022-07-05 10:15:22 -07:00
Sean Ingimarson 9ae6cb3551 linalg commit 2022-07-05 09:21:38 -07:00
Sean Ingimarson 5e0239fccd Tuesday morning commit 2022-07-05 09:11:18 -07:00
Sean Ingimarson 250484450e FCT_Project issues 2022-06-29 16:54:11 -07:00
Sean Ingimarson 8d8c8a2b1b sanity check 2 2022-06-28 15:30:30 -07:00
Sean Ingimarson 95a91ecd80 sanity check 2022-06-28 15:26:01 -07:00
Sean Ingimarson 3244573522 Merge branch 'ingimarson/lor-massavg' of https://github.com/mfem/mfem into ingimarson/lor-massavg 2022-06-27 13:39:47 -07:00
Sean Ingimarson 3201bc26c4 Test 2022-06-27 11:56:39 -07:00
Arturo Vargas 9756b80d40 add fct project 2022-06-27 09:43:04 -07:00
Sean Ingimarson a64838b8bc Renaming 2022-06-20 14:08:04 -07:00
Sean Ingimarson 9f4fd68ddc Reordering 2022-06-20 13:37:51 -07:00
Sean Ingimarson 255e2bba0a Some documentation fixes 2022-06-20 09:58:01 -07:00
Sean Ingimarson 34f9fad9e5 Added proper interpolation function 2022-06-20 09:48:42 -07:00
Sean Ingimarson 180f0f3324 Dof issues 2022-06-17 12:40:48 -07:00
Sean Ingimarson 5c5c5420b6 'graph is bad' commit 2022-06-16 14:47:37 -07:00
Sean Ingimarson 110936de9d running out of commit descriptions 2022-06-16 09:24:13 -07:00
Sean Ingimarson c34bbe3a69 commit before rebuild 2022-06-15 12:02:24 -07:00
Sean Ingimarson 257ae5ebc2 Attempt at dt adjustment 2022-06-14 14:52:57 -07:00
Sean Ingimarson 3539ff8159 Updated cpp file including a fix for the cell averaging refinement and included options for refinement output options 2022-06-14 09:12:49 -07:00
Sean Ingimarson 17c51a4255 pre-meeting commit 2022-06-10 14:46:18 -07:00
Sean Ingimarson af1a6079ec basis type problem 2022-06-10 09:33:41 -07:00
Sean Ingimarson 7da22575cc Making things look prettier with a function 2022-06-09 15:09:26 -07:00
Sean Ingimarson baabd41745 Working Commit 2022-06-09 14:26:47 -07:00
Sean Ingimarson 5a3de8a027 Working commit 2022-06-09 13:52:48 -07:00
Sean Ingimarson 502bc195ba bad pics commit 2022-06-09 13:21:15 -07:00
Sean Ingimarson e0b2774c20 du_LO remove 2022-06-09 09:22:23 -07:00
Sean Ingimarson 0ba2babaf9 u_LO solution commit 2022-06-09 09:13:43 -07:00
Sean Ingimarson 229b84c346 initial commit 2022-06-08 16:30:44 -07:00
4 changed files with 1271 additions and 2 deletions
+1191
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -551,7 +551,7 @@ const DofToQuad &ScalarFiniteElement::GetTensorDofToQuad(
for (int i = 0; i < dof2quad_array.Size(); i++)
{
const DofToQuad &d2q = *dof2quad_array[i];
if (d2q.IntRule == &ir && d2q.mode == mode) { return d2q; }
//if (d2q.IntRule == &ir && d2q.mode == mode) { return d2q; }
}
DofToQuad *d2q = new DofToQuad;
+1
View File
@@ -31,6 +31,7 @@
#include "invariants.hpp"
#include "constraints.hpp"
#include "auxiliary.hpp"
#include "dtensor.hpp"
#ifdef MFEM_USE_AMGX
#include "amgxsolver.hpp"
+78 -1
View File
@@ -75,6 +75,8 @@ int main(int argc, char *argv[])
bool vis = true;
bool useH1 = false;
bool use_pointwise_transfer = false;
int rs_levels = 0;
int mesh_order = 1;
OptionsParser args(argc, argv);
args.AddOption(&mesh_file, "-m", "--mesh",
@@ -84,6 +86,10 @@ int main(int argc, char *argv[])
args.AddOption(&order, "-o", "--order",
"Finite element order (polynomial degree) or -1 for"
" isoparametric space.");
args.AddOption(&mesh_order, "-mo", "--mesh-order",
"Order (degree) of the mesh.");
args.AddOption(&rs_levels, "-rs", "--refine-serial",
"Number of times to refine the mesh uniformly in serial.");
args.AddOption(&lref, "-lref", "--lor-ref-level", "LOR refinement level.");
args.AddOption(&lorder, "-lo", "--lor-order",
"LOR space order (polynomial degree, zero by default).");
@@ -106,10 +112,31 @@ int main(int argc, char *argv[])
// Read the mesh from the given mesh file.
Mesh mesh(mesh_file, 1, 1);
int dim = mesh.Dimension();
for (int lev = 0; lev < rs_levels; lev++) { mesh.UniformRefinement(); }
// Put in 8/1/2022, If we change the mesh order for the mesh it messes
// things up as far as mass goes.
// Check if the input mesh is periodic.
const bool periodic = mesh.GetNodes() != NULL &&
dynamic_cast<const L2_FECollection *>
(mesh.GetNodes()->FESpace()->FEColl()) != NULL;
mesh.SetCurvature(mesh_order, periodic);
// Create the low-order refined mesh
int basis_lor = BasisType::GaussLobatto; // BasisType::ClosedUniform;
Mesh mesh_lor = Mesh::MakeRefined(mesh, lref, basis_lor);
//Mesh mesh_lor(mesh);
//mesh_lor.UniformRefinement();
// Check if the input mesh is periodic.
mesh_lor.SetCurvature(mesh_order, periodic);
OperatorPtr N;
mesh_lor.GetNodalFESpace()->GetTransferOperator(*mesh.GetNodalFESpace(),N);
N->Mult(*mesh.GetNodes(), *mesh_lor.GetNodes());
// Create spaces
FiniteElementCollection *fec, *fec_lor;
@@ -172,6 +199,14 @@ int main(int argc, char *argv[])
const Operator &R = gt->ForwardOperator();
const Operator &P = gt->BackwardOperator();
// Mesh outputs
ofstream meshHO("meshHO.mesh");
meshHO.precision(12);
mesh.Print(meshHO);
ofstream meshLOR("meshLOR.mesh");
meshLOR.precision(12);
mesh_lor.Print(meshLOR);
// HO->LOR restriction
direction = "HO -> LOR @ LOR";
R.Mult(rho, rho_lor);
@@ -182,6 +217,48 @@ int main(int argc, char *argv[])
direction = "HO -> LOR @ HO";
GridFunction rho_prev = rho;
P.Mult(rho_lor, rho);
//---------------------------------------------------------------
// Testing this out instead of using Mult
// This was taken directly from the transfer.cpp file
/*
FiniteElementSpace fes_ho = fespace;
FiniteElementSpace fes_lor = fespace_lor;
Table ho2lor;
GridFunction x_gf = rho;
GridFunction y_gf = rho_lor;
Array<int> offsets;
int vdim = fes_ho.GetVDim();
Array<int> vdofs;
DenseMatrix xel_mat, yel_mat;
for (int iho = 0; iho < fes_ho.GetNE(); ++iho)
{
int nref = ho2lor.RowSize(iho);
int ndof_ho = fes_ho.GetFE(iho)->GetDof();
int ndof_lor = fes_lor.GetFE(ho2lor.GetRow(iho)[0])->GetDof();
xel_mat.SetSize(ndof_ho, vdim);
yel_mat.SetSize(ndof_lor*nref, vdim);
DenseMatrix R_iho(&R[offsets[iho]], ndof_lor*nref, ndof_ho);
fes_ho.GetElementVDofs(iho, vdofs);
x_gf.GetSubVector(vdofs, xel_mat.GetData());
mfem::Mult(R_iho, xel_mat, yel_mat);
// Place result correctly into the low-order vector
for (int iref = 0; iref < nref; ++iref)
{
int ilor = ho2lor.GetRow(iho)[iref];
for (int vd=0; vd<vdim; ++vd)
{
fes_lor.GetElementDofs(ilor, vdofs);
fes_lor.DofsToVDofs(vd, vdofs);
y_gf.SetSubVector(vdofs, &yel_mat(iref*ndof_lor,vd));
}
}
}
*/
//---------------------------------------------------------------
compute_mass(&fespace, ho_mass, HO_dc, "P(R(HO)) ");
if (vis) { visualize(HO_dc, "P(R(HO))", Wx, Wy); Wx = 0; Wy += offy; }
@@ -210,7 +287,7 @@ int main(int argc, char *argv[])
if (vis) { visualize(LOR_dc, "LOR", Wx, Wy); Wx += offx; }
// Prolongate to HO space
direction = "LOR -> HO @ HO";
direction = "LOR -> HO @ HO";
P.Mult(rho_lor, rho);
compute_mass(&fespace, lor_mass, HO_dc, "P(LOR) ");
if (vis) { visualize(HO_dc, "P(LOR)", Wx, Wy); Wx += offx; }