| bp3.cpp (dc00e230834c021cd7c5b556bbaba87dc4209676) | bp3.cpp (16c6c0544ec5338b4f169228ae7dfbd81a255855) |
|---|---|
| 1// libCEED + MFEM Example: BP3 2// 3// This example illustrates a simple usage of libCEED with the MFEM (mfem.org) 4// finite element library. 5// 6// The example reads a mesh from a file and solves a linear system with a 7// diffusion stiffness matrix (with a prescribed analytic solution, provided by 8// the function 'solution'). The diffusion matrix is expressed as a new class, --- 45 unchanged lines hidden (view full) --- 54 f[d] = sin(M_PI*(x[d]+k[d]*pt(d))); 55 l[d] = M_PI*M_PI*k[d]*k[d]*f[d]; 56 lap = lap*f[d] + val*l[d]; 57 val = val*f[d]; 58 } 59 return lap; 60} 61 | 1// libCEED + MFEM Example: BP3 2// 3// This example illustrates a simple usage of libCEED with the MFEM (mfem.org) 4// finite element library. 5// 6// The example reads a mesh from a file and solves a linear system with a 7// diffusion stiffness matrix (with a prescribed analytic solution, provided by 8// the function 'solution'). The diffusion matrix is expressed as a new class, --- 45 unchanged lines hidden (view full) --- 54 f[d] = sin(M_PI*(x[d]+k[d]*pt(d))); 55 l[d] = M_PI*M_PI*k[d]*k[d]*f[d]; 56 lap = lap*f[d] + val*l[d]; 57 val = val*f[d]; 58 } 59 return lap; 60} 61 |
| 62 | 62//TESTARGS -ceed {ceed_resource} -t -no-vis |
| 63int main(int argc, char *argv[]) { 64 // 1. Parse command-line options. 65 const char *ceed_spec = "/cpu/self"; 66#ifndef MFEM_DIR 67 const char *mesh_file = "../../../mfem/data/star.mesh"; 68#else 69 const char *mesh_file = MFEM_DIR "/data/star.mesh"; 70#endif --- 126 unchanged lines hidden --- | 63int main(int argc, char *argv[]) { 64 // 1. Parse command-line options. 65 const char *ceed_spec = "/cpu/self"; 66#ifndef MFEM_DIR 67 const char *mesh_file = "../../../mfem/data/star.mesh"; 68#else 69 const char *mesh_file = MFEM_DIR "/data/star.mesh"; 70#endif --- 126 unchanged lines hidden --- |