/* -*- c -*- * Time-stamp: <2005-04-17 09:57:49 rsmith> * * lamprop/html_out.c * Copyright (C) 2002--2005 R.F. Smith . * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* If you don't want debugging, #define NDEBUG */ #include /* for assert() */ #include /* for M_PI */ #include /* for printf() */ #include "macros.h" #include "lamprop.h" #ifndef PACKAGE #error You must define PACKAGE as the name of the application! #endif #ifndef VERSION #error You must define VERSION as the version of the application! #endif /* This enables you to see which files have been used in building a * binary. N.B, __attribute is a GCC extension, so we test for __GNUC__. */ #ifdef __GNUC__ static char *SCMID __attribute__ ((unused)) = "$Id: html_out.c 36 2005-04-17 09:40:02Z rsmith $"; #endif static const char *fstr[6] = { "Nx", "Ny", "Nxy", "Mx", "My", "Mxy" }; static const char *dstr[6] = { "εx", "εy", "γxy", "κx", "κy", "κxy" }; static void html_engprop(const struct laminate *pl) { int t = 1; struct lamina *l; puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "\ ""); puts(" "); puts(" "); puts(" "); l = (struct lamina *)list_head(pl->lamina); while (l != NULL) { puts(" "); printf(" "\ "\n", t++, l->weight, l->angle*180/M_PI); printf(" \n", l->f->name); puts(" "); l = (struct lamina *)list_next(LISTP(l)); } puts(" "); puts("
Laminate stacking"\ "
LayerWeightAngle"\ "Fiber type
[gr/m²][°]
%d%4.0f%5.0f%s
"); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); printf(" "\ "\n", pl->vf); puts(" "); puts(" "); printf(" "\ "\n", pl->wf); puts(" "); puts(" "); printf(" \n", pl->t); puts(" "); puts(" "); puts(" "); printf(" \n", pl->rho); puts(" "); puts(" "); puts(" "); printf(" \n", pl->rho*pl->t/10*100*100); puts(" "); puts(" "); puts(" "); printf(" \n", pl->rc); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); printf(" \n", pl->Ex); puts(" "); puts(" "); puts(" "); printf(" \n", pl->Ey); puts(" "); puts(" "); puts(" "); printf(" \n", pl->Gxy); puts(" "); puts(" "); puts(" "); printf(" \n", pl->Vxy); puts(" "); puts(" "); puts(" "); printf(" \n", pl->Vyx); puts(" "); puts(" "); puts(" "); printf(" \n", pl->cte_x); puts(" "); puts(" "); puts(" "); printf(" \n", pl->cte_y); puts(" "); puts(" "); puts(" "); puts("
Engineering properties"\ "
PropertyValueDimension
vf%4.2f-
wf%4.2f-
thickness%.3gmm
density%.3ggr/cm³
weight%.0fgr/m²
resin%.0fgr/m²
Ex%8.0fMPa
Ey%8.0fMPa
Gxy%8.0fMPa
νxy%g-
νyx%g-
αx%gK-1
αy%gK-1
"); puts(" "); puts(" "); } static void html_mat(const struct laminate *pl) { int t = 0; puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); printf(" \n", fstr[t]); puts(" "); printf(" "\ "\n", pl->ABD[t][0], pl->ABD[t][1], pl->ABD[t][2]); printf(" "\ "\n", pl->ABD[t][3], pl->ABD[t][4], pl->ABD[t][5]); puts(" "); printf(" \n", dstr[t]); puts(" "); for (t=1; t<6; t++) { puts(" "); printf(" \n", fstr[t]); printf(" "\ "\n", pl->ABD[t][0], pl->ABD[t][1], pl->ABD[t][2]); printf(" "\ "\n", pl->ABD[t][3], pl->ABD[t][4], pl->ABD[t][5]); printf(" \n", dstr[t]); puts(" "); } puts(" "); puts("
Stiffness matrix"\ "
%s=%6.0f%6.0f%6.0f%6.0f%6.0f%6.0f×%s
%s%6.0f%6.0f%6.0f%6.0f%6.0f%6.0f%s
"); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); puts(" "); t=0; puts(" "); printf(" \n", dstr[t]); puts(" "); printf(" "\ "\n", pl->abd[t][0]*1e6, pl->abd[t][1]*1e6, pl->abd[t][2]*1e6); printf(" "\ "\n", pl->abd[t][3]*1e6, pl->abd[t][4]*1e6, pl->abd[t][5]*1e6); puts(" "); printf(" \n", fstr[t]); puts(" "); for (t=1; t<6; t++) { puts(" "); printf(" \n", dstr[t]); printf(" "\ "\n", pl->abd[t][0]*1e6, pl->abd[t][1]*1e6, pl->abd[t][2]*1e6); printf(" "\ "\n", pl->abd[t][3]*1e6, pl->abd[t][4]*1e6, pl->abd[t][5]*1e6); printf(" \n", fstr[t]); puts(" "); } puts(" "); puts("
Compliance matrix"\ "
%s=%6.3g%6.3g%6.3g%6.3g%6.3g%6.3g×10"\ "-6×%s
%s%6.3g%6.3g%6.3g%6.3g%6.3g%6.3g%s
"); puts(" "); puts(" "); } void html_output(const struct laminate *pl, unsigned flags) { assert(pl!=NULL); puts(" "); puts(" "); printf(" \n", pl->name); puts(" "); puts(" "); puts(" "); puts(" "); if ((flags & OF_ENGPROP) == OF_ENGPROP) html_engprop(pl); if ((flags & OF_MAT) == OF_MAT) html_mat(pl); puts(" "); puts("
Properties of %s
"\ "created by "PACKAGE" "VERSION".
"); puts("
"); } /* EOF html_out.c */