Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
13a05ee
master + weak BC enforcement.
vladotomov Dec 26, 2023
77f9aa7
fixed the 3d cube+hole run.
vladotomov Dec 26, 2023
8b91a17
minor
vladotomov Dec 26, 2023
1f5a403
minor
vladotomov Feb 16, 2024
f94953e
updated metis & computer -> new autotest numbers
vladotomov Feb 16, 2024
a138917
added momentum output
vladotomov Feb 18, 2024
2bf85ae
Position errors for the hole tests.
vladotomov Feb 20, 2024
07d9ec0
added missing mesh
vladotomov Mar 15, 2025
626f14c
added submesh, need to add line
Jul 5, 2025
e73592f
forgot to add files
Jul 5, 2025
6eea52b
removed o files
Jul 5, 2025
7d55f66
added Line
Jul 5, 2025
9f5a01f
submesh in parallel
Jul 5, 2025
4539c92
tagged surrogate face
Jul 5, 2025
c954cd7
laying foundations, need to updateBdrQuad for surrogate attributes
Jul 5, 2025
ebb4f6b
update bdrmass coefficients
Jul 5, 2025
51769d4
used actualy energy operator instead of transpose
Jul 5, 2025
a0d98a8
skeleton for sbm
Jul 5, 2025
1172da9
reorganization
Jul 5, 2025
237abba
prepping
Jul 5, 2025
c68df27
missed a spot
Jul 5, 2025
80c9eb3
finished prep for sbm boundary mass
Jul 5, 2025
4239093
updated momentum shifted term
Jul 6, 2025
5647ca2
setting up energy coefficients
Jul 6, 2025
39f6cbe
setup the energy, mostly
Jul 6, 2025
111b210
ready to test
Jul 6, 2025
bab9978
full flexibility
Jul 6, 2025
a77394e
minor
Jul 7, 2025
4dbf3d1
fixed bug in taylor expansion
Jul 16, 2025
1939457
back to shifted = 0
Jul 16, 2025
4060c7e
added update massmatrix, but need to check for bug
Jul 16, 2025
bfe3771
minor
Jul 20, 2025
0cef0e1
removed unnecessary tagging
Jul 20, 2025
3810414
own mass integrators
Aug 3, 2025
03b3c6e
added boundary mass
Aug 3, 2025
f7c1b13
updated integration rule, still update density
Aug 3, 2025
efde349
moved all integrators locally
Aug 3, 2025
c908a69
fix
Aug 4, 2025
a016aee
forgot to add mass integrators
Aug 4, 2025
0347cbc
bug fix
Aug 4, 2025
5feb46d
minor
Aug 4, 2025
2556cc4
minor fix
Aug 5, 2025
ac01f3b
working (still a few little strange effects) for Q1-Q0
Aug 7, 2025
4c290dc
fix
Sep 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions AnalyticalGeometricShape.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
// reserved. See files LICENSE and NOTICE for details.
//
// This file is part of CEED, a collection of benchmarks, miniapps, software
// libraries and APIs for efficient high-order finite element and spectral
// element discretizations for exascale applications. For more information and
// source code availability see http://github.com/ceed.
//
// The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
// a collaborative effort of two U.S. Department of Energy organizations (Office
// of Science and the National Nuclear Security Administration) responsible for
// the planning and preparation of a capable exascale ecosystem, including
// software, applications, hardware, advanced system engineering and early
// testbed platforms, in support of the nation's exascale computing imperative.

#include "AnalyticalGeometricShape.hpp"

namespace mfem
{

AnalyticalGeometricShape::AnalyticalGeometricShape(Mesh *mesh): mesh(mesh){

}
AnalyticalGeometricShape::~AnalyticalGeometricShape(){
}
}
43 changes: 43 additions & 0 deletions AnalyticalGeometricShape.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
// reserved. See files LICENSE and NOTICE for details.
//
// This file is part of CEED, a collection of benchmarks, miniapps, software
// libraries and APIs for efficient high-order finite element and spectral
// element discretizations for exascale applications. For more information and
// source code availability see http://github.com/ceed.
//
// The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
// a collaborative effort of two U.S. Department of Energy organizations (Office
// of Science and the National Nuclear Security Administration) responsible for
// the planning and preparation of a capable exascale ecosystem, including
// software, applications, hardware, advanced system engineering and early
// testbed platforms, in support of the nation's exascale computing imperative.

#ifndef MFEM_ANALYTICAL_GEOMETRIC_SHAPE
#define MFEM_ANALYTICAL_GEOMETRIC_SHAPE

#include "mfem.hpp"

namespace mfem{

class AnalyticalGeometricShape{

protected:
Mesh *mesh;

public:
/// Element type related to shifted boundaries (not interfaces).
/// For more than 1 level-set, we set the marker to CUT+level_set_index
/// to discern between different level-sets.
enum SBElementType {OUTSIDE = 0, INSIDE = 1, CUT = 2};

AnalyticalGeometricShape(Mesh* mesh);
virtual void SetupElementStatus(GridFunction& alpha) = 0;

virtual void ComputeDistanceAndNormal(const Vector& x_ip, Vector& dist, Vector& tn) const = 0;

virtual ~AnalyticalGeometricShape();
};
}
#endif // MFEM_LAGHOS
70 changes: 70 additions & 0 deletions AnalyticalSurface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
// reserved. See files LICENSE and NOTICE for details.
//
// This file is part of CEED, a collection of benchmarks, miniapps, software
// libraries and APIs for efficient high-order finite element and spectral
// element discretizations for exascale applications. For more information and
// source code availability see http://github.com/ceed.
//
// The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
// a collaborative effort of two U.S. Department of Energy organizations (Office
// of Science and the National Nuclear Security Administration) responsible for
// the planning and preparation of a capable exascale ecosystem, including
// software, applications, hardware, advanced system engineering and early
// testbed platforms, in support of the nation's exascale computing imperative.

#include "AnalyticalSurface.hpp"

namespace mfem
{

AnalyticalSurface::AnalyticalSurface(int geometryType, Mesh *mesh):
geometryType(geometryType),
mesh(mesh),
L2FEC_0(0, mesh->Dimension()),
L2_fes_0(mesh, &L2FEC_0),
geometry(NULL)
{
alpha.SetSpace(&L2_fes_0),
alpha = 0.0;

switch (geometryType)
{
case 1: geometry = new Line(mesh); break;
case 2: geometry = new Circle(mesh); break;
default:
out << "Unknown geometry type: " << geometryType << '\n';
break;
}
}

AnalyticalSurface::~AnalyticalSurface()
{
delete geometry;
}

void AnalyticalSurface::SetupElementStatus()
{
geometry->SetupElementStatus(alpha);
}
void AnalyticalSurface::ResetData()
{
alpha = 0.0;
}

GridFunction& AnalyticalSurface::GetAlpha()
{
return alpha;
}
AnalyticalGeometricShape& AnalyticalSurface::GetAnalyticalGeometricShape()
{
return *geometry;
}

void AnalyticalSurface::ComputeDistanceAndNormal(const Vector& x_ip, Vector& dist, Vector& tn) const
{
geometry->ComputeDistanceAndNormal(x_ip, dist, tn);
}

}
50 changes: 50 additions & 0 deletions AnalyticalSurface.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
// reserved. See files LICENSE and NOTICE for details.
//
// This file is part of CEED, a collection of benchmarks, miniapps, software
// libraries and APIs for efficient high-order finite element and spectral
// element discretizations for exascale applications. For more information and
// source code availability see http://github.com/ceed.
//
// The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
// a collaborative effort of two U.S. Department of Energy organizations (Office
// of Science and the National Nuclear Security Administration) responsible for
// the planning and preparation of a capable exascale ecosystem, including
// software, applications, hardware, advanced system engineering and early
// testbed platforms, in support of the nation's exascale computing imperative.

#ifndef MFEM_ANALYTICAL_SURFACE
#define MFEM_ANALYTICAL_SURFACE

#include "mfem.hpp"
#include "general/forall.hpp"
#include "linalg/dtensor.hpp"
#include "Line.hpp"
#include "Circle.hpp"

namespace mfem
{

class AnalyticalSurface
{

protected:
int geometryType;
GridFunction alpha;
AnalyticalGeometricShape *geometry;
Mesh *mesh;
L2_FECollection L2FEC_0;
FiniteElementSpace L2_fes_0;

public:
AnalyticalSurface(int geometryType, Mesh *mesh);
void SetupElementStatus();
void ResetData();
GridFunction& GetAlpha();
AnalyticalGeometricShape& GetAnalyticalGeometricShape();
void ComputeDistanceAndNormal(const Vector& x_ip, Vector& dist, Vector& tn) const;
~AnalyticalSurface();
};
}
#endif // MFEM_LAGHOS
108 changes: 108 additions & 0 deletions Circle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Copyright (c) 2017, Lawrence Livermore National Security, OALLC. Produced at
// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
// reserved. See files LICENSE and NOTICE for details.
//
// This file is part of CEED, a collection of benchmarks, miniapps, software
// libraries and APIs for efficient high-order finite element and spectral
// element discretizations for exascale applications. For more information and
// source code availability see http://github.com/ceed.
//
// The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
// a collaborative effort of two U.S. Department of Energy organizations (Office
// of Science and the National Nuclear Security Administration) responsible for
// the planning and preparation of a capable exascale ecosystem, including
// software, applications, hardware, advanced system engineering and early
// testbed platforms, in support of the nation's exascale computing imperative.


#include "Circle.hpp"

namespace mfem{

Circle::Circle(Mesh* mesh): AnalyticalGeometricShape(mesh), radius(0.2), center(2)
{
center(0) = 0.5;
center(1) = 0.5;
}

Circle::~Circle()
{}

void Circle::SetupElementStatus(GridFunction& alpha)
{
const int max_elem_attr = (mesh->attributes).Max();
int activeCount = 0;
int inactiveCount = 0;
int cutCount = 0;
IntegrationRules IntRulesLo(0, Quadrature1D::GaussLobatto);
alpha = 0.0;
auto fes = alpha.FESpace();
const IntegrationRule &ir = IntRulesLo.Get(fes->GetFE(0)->GetGeomType(), 20);
const int NE = fes->GetNE(), nqp = ir.GetNPoints();
// Check elements on the current MPI rank
for (int e = 0; e < NE; e++)
{
ElementTransformation *Tr = fes->GetElementTransformation(e);
int count = 0;
for (int q = 0; q < nqp; q++)
{
const IntegrationPoint &ip = ir.IntPoint(q);
Tr->SetIntPoint(&ip);
Vector x(3);
Tr->Transform(ip,x);

double radiusOfPt = pow(pow(x(0)-center(0),2.0)+pow(x(1)-center(1),2.0),0.5);
if ( radiusOfPt >= radius)
{
count++;
}
}
if (count == nqp)
{
activeCount++;
alpha(e) = 1.0;
}
else if (count > 0 && count < nqp)
{
cutCount++;
alpha(e) = 0.5;
// mesh->SetAttribute(e, max_elem_attr+1);
}
else if (count == 0)
{
inactiveCount++;
alpha(e) = 0.0;
// mesh->SetAttribute(e, max_elem_attr+1);
}
}
// mesh->SetAttributes();
// std::cout << " active elemSta " << activeCount << " cut " << cutCount << " inacive " << inactiveCount << std::endl;
}

void Circle::ComputeDistanceAndNormal(const Vector& x_ip, Vector& dist, Vector& tn) const
{
dist.SetSize(2);
dist = 0.0;
tn.SetSize(2);
tn = 0.0;

double r = sqrt(pow(x_ip(0)-center(0),2.0)+pow(x_ip(1)-center(1),2.0));
if (r > radius)
{
dist(0) = ((x_ip(0)-center(0))/r)*(radius-r);
dist(1) = ((x_ip(1)-center(1))/r)*(radius-r);
double normD = sqrt(dist(0) * dist(0) + dist(1) * dist(1));
if (normD > 0.0)
{
tn(0) = dist(0) / normD;
tn(1) = dist(1) / normD;
}
}
else
{
dist = 0.0;
tn(0) = (center(0) - x_ip(0)) / radius;
tn(1) = (center(1) - x_ip(1)) / radius;
}
}
}
41 changes: 41 additions & 0 deletions Circle.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
// reserved. See files LICENSE and NOTICE for details.
//
// This file is part of CEED, a collection of benchmarks, miniapps, software
// libraries and APIs for efficient high-order finite element and spectral
// element discretizations for exascale applications. For more information and
// source code availability see http://github.com/ceed.
//
// The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
// a collaborative effort of two U.S. Department of Energy organizations (Office
// of Science and the National Nuclear Security Administration) responsible for
// the planning and preparation of a capable exascale ecosystem, including
// software, applications, hardware, advanced system engineering and early
// testbed platforms, in support of the nation's exascale computing imperative.
#ifndef MFEM_CIRCLE
#define MFEM_CIRCLE

#include "AnalyticalGeometricShape.hpp"

namespace mfem
{
class Circle : public AnalyticalGeometricShape{

protected:
double radius;
Vector center;

public:

Circle(Mesh *mesh);
~Circle();

void SetupElementStatus(GridFunction& alpha);
void ComputeDistanceAndNormal(const Vector& x_ip, Vector& dist, Vector& tn) const;
};

}

#endif // MFEM_LAGHOS

Loading