Skip to content

cwangaw/directPoly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

directPoly

This is a demonstration code for the paper Direct Serendipity and Mixed Finite Elements on Convex Polygons.

Authors

Build and Run

You should make the files to build an executable file directpoly.$(TARG), where TARG is a variable containing the instruction set architecture of your processor. Note that you need CBLAS and LAPACKE library to successfully build the file.

make
./directpoly.$(TARG)

Direct Serendipity Space

Nodal basis functions as defined in the paper on each elements, except for that we choose vertex basis functions to be linear on each edge, are constructed in directSerendipityFE.cpp and assembled in ellipticPDE.cpp to serve as global basis functions. However, in directSerendipityFE.cpp, if you do not want to remove cell degrees of freedom, find the following lines at three places and comment them out.

//Deduct value at interior nodes if needed

for (int k=0; k<nCellNodes(); k++) {
    phi_pt -= phi_e_at_c[k] * value_n[k + num_vertices*polynomial_degree + pt_index*num_nodes];
    gradresult -= phi_e_at_c[k] * gradvalue_n[k + num_vertices*polynomial_degree + pt_index*num_nodes];
}

Direct Mixed Space

You can use either hybrid mixed method or H(div)-conforming mixed spaces by setting the corresponding input in infile.

Interpolation

You could interpolate functions by direct serendipity basis functions and graph the interpolated function as well as its gradient in the following part of ellipticPDE.cpp. You can also directly modify the coefficients of basis functions for mixed spaces, as well as discrete Galerkin spaces for elements and edges, then graph their sum in the following part of mixedPDEConf.cpp and mixedPDEHybrid.cpp.

// TEST BASIS FUNCTIONS //////////////////////////////////////////////////
if(true) {
    ...
}

Solve a PDE

Problem formulation is given in the heading comments of main.cpp. Coefficients a, b, c, D, and all the other related data could be modified in fcns.cpp. Note that the source function as well as Riemann boundary condition are defaultly calculated by true solution. If in your formulation, analytical solution is unknown, please rewrite these parts.

Output

Basic results of running the codes are printed to the terminal. All the output files would be stored preambly in test/ directory, which could be modified in the first line of infile.

Acknowledgments

The development of this code has been supported by the U.S. National Science Foundation.

Copyrights

Copyright (C) 2022 Todd Arbogast and Chuning Wang

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages