Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79965830
test_gradient_triangle_3.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 29, 05:29
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Aug 31, 05:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20271699
Attached To
rAKA akantu
test_gradient_triangle_3.cc
View Options
/**
* @file test_gradient_triangle_3.cc
* @author Nicolas Richart <nicolas.richart@epfl.ch>
* @date Mon Jul 19 10:55:49 2010
*
* @brief test of the fem class
*
* @section LICENSE
*
* \<insert license here\>
*
*/
/* -------------------------------------------------------------------------- */
#include <cstdlib>
#include <fstream>
/* -------------------------------------------------------------------------- */
#include "aka_common.hh"
#include "fem.hh"
#include "mesh.hh"
#include "mesh_io.hh"
#include "mesh_io_msh.hh"
/* -------------------------------------------------------------------------- */
using namespace akantu;
int main(int argc, char *argv[]) {
MeshIOMSH mesh_io;
Mesh my_mesh(2);
mesh_io.read("square1.msh", my_mesh);
FEM *fem = new FEM(my_mesh,2,"my_fem");
debug::setDebugLevel(dblDump);
fem->initShapeFunctions();
std::cout << *fem << std::endl;
StaticMemory * st_mem = StaticMemory::getStaticMemory();
std::cout << *st_mem << std::endl;
Vector<Real> const_val(fem->getMesh().getNbNodes(), 2, "const_val");
Vector<Real> grad_on_quad(0, 2*2, "grad_on_quad");
for (UInt i = 0; i < const_val.getSize(); ++i) {
const_val.values[i * 2 + 0] = 1.;
const_val.values[i * 2 + 1] = 2.;
}
fem->gradientOnQuadraturePoints(const_val, grad_on_quad, 2, _triangle_3);
std::ofstream my_file("out.txt");
my_file << const_val << std::endl;
my_file << grad_on_quad << std::endl;
// compute gradient of coordinates
Vector<Real> grad_coord_on_quad(0, 4, "grad_coord_on_quad");
fem->gradientOnQuadraturePoints(my_mesh.getNodes(), grad_coord_on_quad, my_mesh.getSpatialDimension(), _triangle_3);
my_file << my_mesh.getNodes() << std::endl;
my_file << grad_coord_on_quad << std::endl;
// delete fem;
// finalize();
return EXIT_SUCCESS;
}
Event Timeline
Log In to Comment